0

in the command line i m giving input as

filename option

here option starting with hyphen.

how to pass command line arguments starts with -

2 Answers 2

3

The list of all the arguments passed to the process hosting your Tcl interpreter can be accessed using the global variable argv, which you can iterate over and inspect.

Special packages implementing ready-made solutions for "declarative" parsing of command-line arguments exist, with cmdline being one example. Also search the wiki for alternatives.

Sign up to request clarification or add additional context in comments.

1 Comment

The argc global can also be useful occasionally, but it's really just the same as llength $argv
1

I think, you need the cmdline package from tcllib.

Documentation is here

http://tcllib.sourceforge.net/doc/cmdline.html

Joachim

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.