Skip to content

Commit

Permalink
codacity issues
Browse files Browse the repository at this point in the history
  • Loading branch information
mailund committed Jun 25, 2021
1 parent 2341220 commit cc735b6
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ where `cmd` is the command line tool, the first flags, `-x` and `-foo` are optio

Go's `flag` package handles flags, and does it very well, but it doesn't handle arguments or subcommands. There are other packages that implement support for subcommands, but not any that I much liked, so I implemented this module to get something more to my taste.


## Commands

Commands are created with the `NewCommand` function from a command specification. The specification provides information about the name of the command, documentation as two strings, a short used when listing subcommands and a long used when showing usage of a specific command.
Expand Down Expand Up @@ -83,7 +82,6 @@ To set up arguments, you proved another function, `Init`. It should return an `i

We could set up our command for adding two numbers like this:


```go
add := cli.NewCommand(
cli.CommandSpec{
Expand Down Expand Up @@ -156,7 +154,6 @@ cmd := cli.NewCommand(
})
```


Simply setting `argv.Round = true` before we return from `Init` will make `true` the default value for the flag.

You can nest commands to make subcommands. Say we want a tool that can do both addition and multiplication. We can create a command with two subcommands to achieve this. The straightforward way to do this is to give a command a `Subcommands` in its specification. It can look like this:
Expand Down

0 comments on commit cc735b6

Please sign in to comment.