Skip to content

Add a -c option to execute a command#213

Merged
prsabahrami merged 2 commits intoprefix-dev:mainfrom
certik:cmd
Jan 29, 2025
Merged

Add a -c option to execute a command#213
prsabahrami merged 2 commits intoprefix-dev:mainfrom
certik:cmd

Conversation

@certik
Copy link
Collaborator

@certik certik commented Jan 29, 2025

Handle exit code correctly. Use it like this:

$ shell -c "echo 'ok'"
ok
$ echo $?
0
$ shell -c "echox 'ok'"
echox: command not found
$ echo $?
127

Fixes #211.

@certik certik requested a review from wolfv January 29, 2025 03:42
Handle exit code correctly. Use it like this:

    $ shell -c "echo 'ok'"
    ok
    $ echo $?
    0
    $ shell -c "echox 'ok'"
    echox: command not found
    $ echo $?
    127

Fixes prefix-dev#211.
Copy link
Contributor

@prsabahrami prsabahrami left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This indeed is great!

@prsabahrami prsabahrami enabled auto-merge (squash) January 29, 2025 06:02
@prsabahrami prsabahrami merged commit 787ad40 into prefix-dev:main Jan 29, 2025
6 checks passed
@certik certik deleted the cmd branch January 29, 2025 06:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add an ability to specify a command

2 participants

Comments