Skip to content

Replaced PowerArgs with McMaster.Extensions.CommandLineUtils - #1289

Merged
khellang merged 4 commits into
devfrom
features/new-parsing-lib
Aug 15, 2018
Merged

khellang merged 4 commits into
devfrom
features/new-parsing-lib

Conversation

@filipw

@filipw filipw commented Aug 8, 2018

Copy link
Copy Markdown
Member

This causes some breaking changes on the exe surface, but I think there is no other way to tackle this. It is really needed because PowerArgs doesn't seem to work with Mono so we have some really critical issues there.

It also allows us to add some sanity to the command line parameters, which I think is quite welcome. What we had before as the arg surface was never really designed for usability, it was just something that we got automatically by plugging in PowerArgs. Regardless, I tried to keep breaking changes to the bare minimum.

Here is the overview. The main difference is that the "long names" are now -- instead of - (which, if you ask me, is much better anyway). The shortnames are all the same. Another difference is that we now have a scriptcs install command to deal with installation tasks.

operation old new
run script scriptcs -script <name> the same
run script scriptcs -scriptname <name> scriptcs --scriptname <name>
run script scriptcs <name> the same
run repl scriptcs -r the same
run repl scriptcs -repl scriptcs --repl
run repl scriptcs the same
evaluate code scriptcs -e <code> the same
evaluate code scriptcs -eval <code> scriptcs --eval <code>
show help scriptcs -? the same
show help scriptcs -help scriptcs --help
show version scriptcs -v the same
show version scriptcs -version scriptcs --version
run a script in debug mode scriptcs <name> -d the same
run a script in debug mode scriptcs <name> -debug scriptcs <name> --debug
run a script from cache scriptcs <name> -c the same
run a script from cache scriptcs <name> -cache scriptcs <name> --cache
run a script with certain log level scriptcs <name> -log <level> the same
run a script with certain log level scriptcs <name> -loglevel <level> scriptcs <name> --loglevel <level>
run a script with watching scriptcs <name> -w the same
run a script with watching scriptcs <name> -watch scriptcs <name> --watch
run a script with modules scriptcs <name> -m <module1>,<module2> the same
run a script with modules scriptcs <name> -modules <module1>,<module2> scriptcs <name> --modules <module1>,<module2>
run a script with custom config scriptcs <name> -co <path> the same
run a script with custom config scriptcs <name> -config <path> scriptcs <name> --config <path>
run a script with output file scriptcs <name> -o <path> the same
run a script with output file scriptcs <name> -output <path> scriptcs <name> --output <path>
install a package scriptcs -install <package name> scriptcs install <package name>
install a package scriptcs -i <package name> scriptcs install <package name>
install a package with prerelease version scriptcs -install <package name> -pre scriptcs install <package name> -pre
install a package with prerelease version scriptcs -i <package name> -pre scriptcs install <package name> -pre
install a package with prerelease version scriptcs -install <package name> -allowprerelease scriptcs install <package name> --allowprerelease
install a package with prerelease version scriptcs -i <package name> -allowprerelease scriptcs install <package name> --allowprerelease
install a package to a global location scriptcs -install <package name> -g scriptcs install <package name> -g
install a package to a global location scriptcs -i <package name> -g scriptcs install <package name> -g
install a package to a global location scriptcs -install <package name> -global scriptcs install <package name> --global
install a package to a global location scriptcs -i <package name> -global scriptcs install <package name> --global
create a packages.config based on packages folder scriptcs -save scriptcs install --save
create a packages.config based on packages folder scriptcs -s scriptcs install -s
clean installed packages scriptcs -clean scriptcs install --clean
clean installed packages scriptcs -cl scriptcs install -cl

Fixes #1188
Fixes #840

@filipw
filipw requested review from jrusbatch and khellang August 8, 2018 09:49
@filipw

filipw commented Aug 8, 2018

Copy link
Copy Markdown
Member Author

When merged, this information should be incorporated into #1287

@filipw

filipw commented Aug 15, 2018

Copy link
Copy Markdown
Member Author

ping @khellang @jrusbatch 🚨

@khellang khellang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@filipw Can you rebase this? It includes the diff for #1285 and #1286 as well 🤔

Comment thread src/ScriptCs.Core/FrameworkUtils.cs Outdated
if (_frameworkName == null)
{
// in order to handle the weird behavior of old nuget packages
// with NET Standard 2.0, we'll use the entry assemblie if possible

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: assemblie

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's a pet name 🤠

@filipw
filipw force-pushed the features/new-parsing-lib branch from 6c28be6 to 00f98a3 Compare August 15, 2018 09:39

@khellang khellang left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the changes look good, assuming we're fine with the CLI breaking changes. Looks like the AppVeyor build failed for some reason, though.

@filipw

filipw commented Aug 15, 2018

Copy link
Copy Markdown
Member Author

I think the changes look good, assuming we're fine with the CLI breaking changes.

I personally am, I think this is for the greater good, especially if it's well documented. That said if this is a red flag in your mind, speak up 🤠

Looks like the AppVeyor build failed for some reason, though.

I think this is similar to #1277, there is some race condition on the acceptance tests, it passed when I retried.

@khellang

Copy link
Copy Markdown
Member

Yeah, I think the new args are much cleaner and POSIX compliant 👍

@khellang
khellang merged commit 5599cb5 into dev Aug 15, 2018
@khellang
khellang deleted the features/new-parsing-lib branch August 15, 2018 11:54
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

Successfully merging this pull request may close these issues.

2 participants