Skip to content
This repository has been archived by the owner on Feb 4, 2019. It is now read-only.

Command line switches #406

Open
ForNeVeR opened this issue Jan 8, 2016 · 1 comment
Open

Command line switches #406

ForNeVeR opened this issue Jan 8, 2016 · 1 comment

Comments

@ForNeVeR
Copy link
Contributor

ForNeVeR commented Jan 8, 2016

With PowerShell (or even bash) I can execute commands as powershell -Command "2 + 2" or powershell -c 2 + 2.

Pash introduces another convention without that -c option: just pash "2 + 2". Although pash 2 + 2 will not work:

$ pash 2 + 2
Parse error at (0:4): Syntax error, expected: (, $(, @(, {, @{, decimal_integer_literal, ...
> 2; +; 2;
      ^
  +CategoryInfo: ParserError, Reason: ParseException
  +FullyQualifiedErrorId: Parse

What command line argument scheme should we use? Both PowerShell and bash have other useful switches aside -c, and the "default" mode for them is to treat the parameter as a filename.

Maybe Pash should follow the same convention? E.g. pash file.ps1 will execute a file (and nothing else), but pash -c "2 + 2" or even pash -c 2 + 2 should execute an inline command.

@JayBazuzi
Copy link
Contributor

IMO, we should try to mimic PowerShell, as much as it makes sense.

For reference, these work in PowerShell:

C:\>powershell 2 + 2
4

C:\>powershell "2 + 2"
4

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants