-
Notifications
You must be signed in to change notification settings - Fork 687
CLI v2 #3600
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
Draft
bentsherman
wants to merge
61
commits into
master
Choose a base branch
from
3595-nf-cli
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
CLI v2 #3600
Changes from all commits
Commits
Show all changes
61 commits
Select commit
Hold shift + click to select a range
df66de1
wip [ci skip]
bentsherman d0ee2d8
Update tests
bentsherman bb1a9b9
Remove `kuberun` command from v2 CLI
bentsherman d4f5cf2
minor edits [ci skip]
bentsherman 6c23771
Add proper params parsing to CLI v2 [ci fast]
bentsherman e31ff64
Update params parsing in CLI v2 to match v1 [ci fast]
bentsherman 5f62ff2
Add fallback values to CLI options, fix some error messages [ci fast]
bentsherman a2063eb
Minor improvements
bentsherman 49c49a8
Fix issue with multiple positional args, update tests [ci fast]
bentsherman 0462ac2
Revert build files to use v1 CLI, add launch-v2.sh to test v2 CLI
bentsherman 9b34186
Minor edits
bentsherman fb5675d
Fix bug with plugin command
bentsherman e50ed67
Merge branch 'master' into 3595-nf-cli
bentsherman b54a217
Fix several bugs and inconsistencies
bentsherman f48635b
Fix failing tests
bentsherman 8a4ed78
Merge branch 'master' into 3595-nf-cli
pditommaso 574d853
Merge branch '3595-nf-cli' of github.com:nextflow-io/nextflow into 35…
bentsherman 78ef208
Fix several parsing errors
bentsherman 6363f5c
Allow subcommands to be specified as option values
bentsherman b21a7f3
Merge branch 'master' into 3595-nf-cli
bentsherman b6dea75
Merge branch 'master' into 3595-nf-cli
pditommaso 09e95e5
Merge branch 'master' into 3595-nf-cli
bentsherman 93dc032
Merge branch 'master' into 3595-nf-cli
bentsherman 4bbac21
Add `nf` binary
bentsherman eab9d60
Fix issue with ansi logger
bentsherman cdbd00c
Merge branch 'master' into 3595-nf-cli
bentsherman fcbddf5
Cleanup
bentsherman fc54c4e
Put CLI v1 code back into original command classes
bentsherman 40d3010
Cleanup
bentsherman 3eae972
Cleanup
bentsherman 807b848
Cleanup
bentsherman 78509d9
Update tests
bentsherman d6da4e1
Cleanup
bentsherman 78cd98b
Merge branch 'master' into 3595-nf-cli
bentsherman 5130c33
Fix inspect command
bentsherman 3d0b1ae
Fix failing test
bentsherman 79c6db1
Merge branch 'master' into 3595-nf-cli
bentsherman c1bf2a8
Rename `--deep` to `--depth` to match git
bentsherman 07e20e6
Remove `-dsl1` and `-dsl2` options
bentsherman e5dd327
Remove `-without-*` options from CLI v2
bentsherman 33ab7be
Update docs
bentsherman 2c9eb7f
Add nf to install procedure
bentsherman 956170e
Merge branch 'master' into 3595-nf-cli
bentsherman f38fe0b
Fix build errors
bentsherman 04e046f
Fix failing tests
bentsherman d6e727f
Fix bugs
bentsherman 2377bd5
Minor edits
bentsherman e578b3e
FIx inspect command
bentsherman d0481d7
Fix help text for run options
bentsherman d697749
Disable clustered short options
bentsherman cb62507
Make v1 option warning yellow
bentsherman a08f6a5
Merge branch 'master' into 3595-nf-cli
bentsherman e24ed5b
Merge branch 'master' into 3595-nf-cli
marcodelapierre dc1625d
Fix merge conflicts
bentsherman eb10b07
Fix map options in run command
bentsherman 0e4db16
Remove ANSI shim from params helper
bentsherman ec41239
Add --background to run command
bentsherman 0d6eb3f
Minor edits
bentsherman 07f01c8
Mergre upstream changes
bentsherman 074556c
cleanup
bentsherman abe7514
Remove positional args from v2 run, inspect
bentsherman File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2013-2023, Seqera Labs | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
cwd="$(realpath "$(dirname "$0")")" | ||
|
||
MAIN_CLASS="nextflow.cli.Launcher" "${cwd}/launch.sh" "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
#!/bin/bash | ||
# | ||
# Copyright 2013-2023, Seqera Labs | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
cwd="$(realpath "$(dirname "$0")")" | ||
|
||
MAIN_CLASS="nextflow.cli.v2.Launcher" "${cwd}/launch.sh" "$@" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,79 +28,100 @@ import org.fusesource.jansi.Ansi | |
* @author Paolo Di Tommaso <[email protected]> | ||
*/ | ||
@Slf4j | ||
class CliOptions { | ||
abstract class CliOptions { | ||
|
||
abstract Boolean getAnsiLogCli() | ||
abstract boolean isBackground() | ||
abstract List<String> getConfig() | ||
abstract List<String> getDebug() | ||
abstract boolean getIgnoreConfigIncludes() | ||
abstract String getLogFile() | ||
abstract boolean isQuiet() | ||
abstract boolean getRemoteDebug() | ||
abstract String getSyslog() | ||
abstract List<String> getTrace() | ||
abstract List<String> getUserConfig() | ||
abstract boolean getVersion() | ||
abstract void setAnsiLog(boolean value) | ||
abstract void setBackground(boolean value) | ||
|
||
static class V1 extends CliOptions { | ||
|
||
/** | ||
* The packages to debug | ||
*/ | ||
@Parameter(hidden = true, names='-debug') | ||
List<String> debug | ||
|
||
@Parameter(names=['-log'], description = 'Set nextflow log file path') | ||
String logFile | ||
|
||
@Parameter(names=['-c','-config'], description = 'Add the specified file to configuration set') | ||
List<String> userConfig | ||
|
||
@Parameter(names=['-config-ignore-includes'], description = 'Disable the parsing of config includes') | ||
boolean ignoreConfigIncludes | ||
|
||
@Parameter(names=['-C'], description = 'Use the specified configuration file(s) overriding any defaults') | ||
List<String> config | ||
|
||
/** | ||
* the packages to trace | ||
*/ | ||
@Parameter(names='-trace', description = 'Enable trace level logging for the specified package name - multiple packages can be provided separating them with a comma e.g. \'-trace nextflow,io.seqera\'') | ||
List<String> trace | ||
|
||
/** | ||
* Enable syslog appender | ||
*/ | ||
@Parameter(names = ['-syslog'], description = 'Send logs to syslog server (eg. localhost:514)' ) | ||
String syslog | ||
|
||
/** | ||
* Print out the version number and exit | ||
*/ | ||
@Parameter(names = ['-v','-version'], description = 'Print the program version') | ||
boolean version | ||
|
||
/** | ||
* Print out the 'help' and exit | ||
*/ | ||
@Parameter(names = ['-h'], description = 'Print this help', help = true) | ||
boolean help | ||
|
||
@Parameter(names = ['-q','-quiet'], description = 'Do not print information messages' ) | ||
boolean quiet | ||
|
||
@Parameter(names = ['-bg','-background'], description = 'Execute nextflow in background', arity = 0) | ||
boolean background | ||
|
||
@DynamicParameter(names = ['-D'], description = 'Set JVM properties' ) | ||
Map<String,String> jvmOpts = [:] | ||
|
||
@Parameter(names = ['-self-update'], description = 'Update nextflow to the latest version', arity = 0, hidden = true) | ||
boolean selfUpdate | ||
|
||
@Parameter(names=['-remote-debug'], description = "Enable JVM interactive remote debugging (experimental)") | ||
boolean remoteDebug | ||
|
||
Boolean ansiLogCli | ||
|
||
void setAnsiLog(boolean value) { ansiLogCli = value } | ||
|
||
/** | ||
* The packages to debug | ||
*/ | ||
@Parameter(hidden = true, names='-debug') | ||
List<String> debug | ||
|
||
@Parameter(names=['-log'], description = 'Set nextflow log file path') | ||
String logFile | ||
|
||
@Parameter(names=['-c','-config'], description = 'Add the specified file to configuration set') | ||
List<String> userConfig | ||
|
||
@Parameter(names=['-config-ignore-includes'], description = 'Disable the parsing of config includes') | ||
boolean ignoreConfigIncludes | ||
|
||
@Parameter(names=['-C'], description = 'Use the specified configuration file(s) overriding any defaults') | ||
List<String> config | ||
|
||
/** | ||
* the packages to trace | ||
*/ | ||
@Parameter(names='-trace', description = 'Enable trace level logging for the specified package name - multiple packages can be provided separating them with a comma e.g. \'-trace nextflow,io.seqera\'') | ||
List<String> trace | ||
|
||
/** | ||
* Enable syslog appender | ||
*/ | ||
@Parameter(names = ['-syslog'], description = 'Send logs to syslog server (eg. localhost:514)' ) | ||
String syslog | ||
|
||
/** | ||
* Print out the version number and exit | ||
*/ | ||
@Parameter(names = ['-v','-version'], description = 'Print the program version') | ||
boolean version | ||
|
||
/** | ||
* Print out the 'help' and exit | ||
*/ | ||
@Parameter(names = ['-h'], description = 'Print this help', help = true) | ||
boolean help | ||
|
||
@Parameter(names = ['-q','-quiet'], description = 'Do not print information messages' ) | ||
boolean quiet | ||
|
||
@Parameter(names = ['-bg'], description = 'Execute nextflow in background', arity = 0) | ||
boolean background | ||
|
||
@DynamicParameter(names = ['-D'], description = 'Set JVM properties' ) | ||
Map<String,String> jvmOpts = [:] | ||
|
||
@Parameter(names = ['-self-update'], description = 'Update nextflow to the latest version', arity = 0, hidden = true) | ||
boolean selfUpdate | ||
|
||
@Parameter(names=['-remote-debug'], description = "Enable JVM interactive remote debugging (experimental)") | ||
boolean remoteDebug | ||
|
||
Boolean ansiLog | ||
} | ||
|
||
boolean getAnsiLog() { | ||
if( ansiLog && quiet ) | ||
if( ansiLogCli && quiet ) | ||
throw new AbortOperationException("Command line options `quiet` and `ansi-log` cannot be used together") | ||
|
||
if( ansiLog != null ) | ||
return ansiLog | ||
if( ansiLogCli != null ) | ||
return ansiLogCli | ||
|
||
if( background ) | ||
return ansiLog = false | ||
return ansiLogCli = false | ||
|
||
if( quiet ) | ||
return ansiLog = false | ||
return ansiLogCli = false | ||
|
||
final env = System.getenv('NXF_ANSI_LOG') | ||
if( env ) try { | ||
|
@@ -113,7 +134,7 @@ class CliOptions { | |
} | ||
|
||
boolean hasAnsiLogFlag() { | ||
ansiLog==true || System.getenv('NXF_ANSI_LOG')=='true' | ||
ansiLogCli==true || System.getenv('NXF_ANSI_LOG')=='true' | ||
} | ||
|
||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,12 +17,14 @@ | |
package nextflow.cli | ||
|
||
import com.beust.jcommander.Parameter | ||
import groovy.transform.CompileStatic | ||
|
||
/** | ||
* Implement command shared methods | ||
* | ||
* @author Paolo Di Tommaso <[email protected]> | ||
*/ | ||
@CompileStatic | ||
abstract class CmdBase implements Runnable { | ||
|
||
private Launcher launcher | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.