Skip to content
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

Plugin did not take subcommand options #5084

Open
sfc-gh-hyu opened this issue Jun 20, 2024 · 0 comments
Open

Plugin did not take subcommand options #5084

sfc-gh-hyu opened this issue Jun 20, 2024 · 0 comments

Comments

@sfc-gh-hyu
Copy link

I am trying to develop a plugin against nextflow, however, it seems that subcommand options is considered as a parent command options:

Here is a simple plugin:

class MyPlugin extends BasePlugin implements PluginAbstractExec{

    MyPlugin(PluginWrapper wrapper) {
        super(wrapper)
    }

    @Override
    List<String> getCommands() {
        [ 'run' ]
    }

    @Override
    int exec(String cmd, List<String> args) {
        System.out.println("command array: " + Arrays.toString(args))
        if( cmd == 'run' ) {
            return 0
        }
        else {
            System.err.println "Invalid command: ${cmd}"
            return 1
        }
    }
}

When I run the plugin

$ ./launch.sh plugin nf-foo:run
command array: [[]]
$ ./launch.sh plugin nf-foo:run --foo bar
Unknown option: --foo=bar -- Check the available commands and options and syntax with 'help'

Did I miss anything?

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

No branches or pull requests

1 participant