Skip to content

Commit

Permalink
FEATURE: add a main command to toolkit.nu (nushell#9135)
Browse files Browse the repository at this point in the history
# Description
until now, a call to `toolkit` alone would give
```bash
Error: nu::shell::external_command

  × External command failed
   ╭─[entry nushell#2:1:1]
 1 │ toolkit
   · ───┬───
   ·    ╰── did you mean 'toolkit clippy'?
   ╰────
  help: No such file or directory (os error 2)
```
which i find confusing after a `use toolkit.nu` 🤔 

this PR adds a `main` command to `toolkit.nu` which runs the `help`
command on the module.

# User-Facing Changes
now
```
> use toolkit.nu
> toolkit
Usage:
  > toolkit

Subcommands:
  toolkit check pr - run all the necessary checks and tests to submit a perfect PR
  toolkit clippy - check that you're using the standard code style
  toolkit fmt - check standard code formatting and apply the changes
  toolkit setup-git-hooks - set up git hooks to run:
- `toolkit fmt --check --verbose` on `git commit`
- `toolkit fmt --check --verbose` and `toolkit clippy --verbose` on `git push`
  toolkit test - check that all the tests pass
  toolkit test stdlib - run the tests for the standard library

Flags:
  -h, --help - Display the help message for this command
```

# Tests + Formatting
- 🟢 `toolkit fmt`
- 🟢 `toolkit clippy`
- ⚫ `toolkit test`
- ⚫ `toolkit test stdlib`

# After Submitting
```
$nothing
```
  • Loading branch information
amtoine committed May 8, 2023
1 parent a2dd948 commit a5af77d
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions toolkit.nu
Original file line number Diff line number Diff line change
Expand Up @@ -245,3 +245,5 @@ export def setup-git-hooks [] {
print $"aborting ('toolkit setup-git-hooks' | pretty-print-command)"
}
}

export def main [] { help toolkit }

0 comments on commit a5af77d

Please sign in to comment.