I was trying out a calc program taking in operators and operands as cli values. Worked out for everything else except '*'.
If I run cargo run -- 1 * 2
the * gets replaced by Cargo.toml Cargo.lock src target. Basically every file in directory. So I'm guessing run takes * as a wildcard. I'm running multiply as cargo run -- 1 \* 2
and that seems to work. Is there a way to by pass this behavior and simply use *?
Specifically, this is a feature of your shell. See documentation for wildcards in bash, globs in zsh or Wildcards in PowerShell, for Linux, Mac and Windows respectively. (In linux, one might install zsh, or another shell, but most distributions default to bash). All of these shells have slightly different behaviors, but * is pretty globally the pattern for "zero or more characters", and all three will by default expand patterns to all filenames which match them.