Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return 0 as an exit status when no subcommand is given to bootstrap #45535

Merged
merged 1 commit into from
Oct 28, 2017

Conversation

topecongiro
Copy link
Contributor

Running ./x.py emits usage and error messages when no subcommand is given:

Usage: x.py <subcommand> [options] [<paths>...]

Subcommands:
    build       Compile either the compiler or libraries
    test        Build and run some test suites
    bench       Build and run some benchmarks
    doc         Build documentation
    clean       Clean out build directories
    dist        Build distribution artifacts
    install     Install distribution artifacts

To learn more about a subcommand, run `./x.py <subcommand> -h`

failed to run: /home/topecongiro/rust/build/bootstrap/debug/bootstrap

IMHO the last line is unnecessary. This PR removes it by changing the return code of bootstrap to 0 when no sub command is given.

@rust-highfive
Copy link
Collaborator

r? @nikomatsakis

(rust_highfive has picked a reviewer for you, use r? to override)

@kennytm kennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 26, 2017
Copy link
Member

@kennytm kennytm left a comment

Choose a reason for hiding this comment

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

The error code was explicitly changed from 0 to 1 in #44134. Could you ensure ./x.py nonsense still returns nonzero?

@topecongiro
Copy link
Contributor Author

@kennytm Thank you for the review! I updated the PR so that ./x.py returns 0 and ./x.py nonsense returns 1.

@kennytm kennytm added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Oct 26, 2017
Copy link
Member

@kennytm kennytm left a comment

Choose a reason for hiding this comment

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

Minor nit. r=me after this is fixed.

@@ -136,9 +136,12 @@ To learn more about a subcommand, run `./x.py <subcommand> -h`");
let subcommand = match subcommand {
Some(s) => s,
None => {
// No subcommand -- show the general usage and subcommand help
// No or an invlaid subcommand -- show the general usage and subcommand help
Copy link
Member

Choose a reason for hiding this comment

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

Typo: invlaidinvalid.

@topecongiro
Copy link
Contributor Author

@kennytm Thanks again, fixed a typo and rebased.

@kennytm
Copy link
Member

kennytm commented Oct 27, 2017

@bors r+ rollup

Thanks!

@bors
Copy link
Contributor

bors commented Oct 27, 2017

📌 Commit 732d9b2 has been approved by kennytm

@kennytm kennytm added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Oct 27, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Oct 28, 2017
…kennytm

Return 0 as an exit status when no subcommand is given to bootstrap

Running `./x.py` emits usage and error messages when no subcommand is given:
```
Usage: x.py <subcommand> [options] [<paths>...]

Subcommands:
    build       Compile either the compiler or libraries
    test        Build and run some test suites
    bench       Build and run some benchmarks
    doc         Build documentation
    clean       Clean out build directories
    dist        Build distribution artifacts
    install     Install distribution artifacts

To learn more about a subcommand, run `./x.py <subcommand> -h`

failed to run: /home/topecongiro/rust/build/bootstrap/debug/bootstrap
```
IMHO the last line is unnecessary. This PR removes it by changing the return code of `bootstrap` to 0 when no sub command is given.
kennytm added a commit to kennytm/rust that referenced this pull request Oct 28, 2017
…kennytm

Return 0 as an exit status when no subcommand is given to bootstrap

Running `./x.py` emits usage and error messages when no subcommand is given:
```
Usage: x.py <subcommand> [options] [<paths>...]

Subcommands:
    build       Compile either the compiler or libraries
    test        Build and run some test suites
    bench       Build and run some benchmarks
    doc         Build documentation
    clean       Clean out build directories
    dist        Build distribution artifacts
    install     Install distribution artifacts

To learn more about a subcommand, run `./x.py <subcommand> -h`

failed to run: /home/topecongiro/rust/build/bootstrap/debug/bootstrap
```
IMHO the last line is unnecessary. This PR removes it by changing the return code of `bootstrap` to 0 when no sub command is given.
bors added a commit that referenced this pull request Oct 28, 2017
Rollup of 7 pull requests

- Successful merges: #45421, #45449, #45505, #45535, #45549, #45574, #45585
- Failed merges:
@bors bors merged commit 732d9b2 into rust-lang:master Oct 28, 2017
@topecongiro topecongiro deleted the bootstrap-exit-code branch October 28, 2017 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants