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

example not executing as documented. #138

Closed
drewverlee opened this issue Jun 7, 2021 · 1 comment
Closed

example not executing as documented. #138

drewverlee opened this issue Jun 7, 2021 · 1 comment

Comments

@drewverlee
Copy link

version

0.4.3

platform

[ Please specify which platform you are using clj-matic on, like JVM or JS and which version ]

JVM

[ Please provide a short and to the point description of the problem ]

examples/toycalc-nested.clj doesn't work as documented.

[ Please provide a minimal working reproduction of the problem ]

➜  cli-matic git:(master) ✗ ./examples/toycalc-nested.clj -base 16 subc sub --a 16 --b 3
** ERROR: **
Global option error: Unknown option: "-b"
Unknown option: "-a"
Unknown option: "-s"
Unknown option: "-e"


NAME:
 toycalc - A command-line toy calculator

USAGE:
 toycalc [global-options] command [command options] [arguments...]

VERSION:
 0.0.1

COMMANDS:
   add                  Adds two numbers together
   subc                 Subtracts parameter B from A

GLOBAL OPTIONS:
       --base N  10  The number base for output
   -?, --help

[ What is the behavior you expected to see from clj-matic? Please provide a minimal working example ]

from the docs the output should be d

[ What is the actual behavior of clj-matic? ]

Actual behavior is an error for unknown options.

@timgilbert
Copy link

I think the problem here is that you're passing a CLI of -base instead of --base (note the two hyphens). If I run this with --base I get the expected result:

❯ ./examples/toycalc-nested.clj --base 16 subc sub --a 16 --b 3
WARNING: Implicit use of clojure.main with options is deprecated, use -M
d

@l3nz l3nz closed this as completed Apr 7, 2022
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

No branches or pull requests

3 participants