Skip to content

Commit

Permalink
Document fs CLI command (nextflow-io#4328)
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Sherman <[email protected]>
  • Loading branch information
bentsherman authored Sep 21, 2023
1 parent 9b3741e commit 1a68049
Show file tree
Hide file tree
Showing 2 changed files with 62 additions and 2 deletions.
60 changes: 60 additions & 0 deletions docs/cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -550,6 +550,66 @@ Forcefully drop the `nextflow-io/hello` pipeline, ignoring any local changes.
$ nextflow drop nextflow-io/hello -f
```

### fs

Perform basic filesystem operations.

**Usage**

```console
$ nextflow fs [subcommands]
```

**Description**

The `fs` command is used to perform filesystem operations like copy, move, delete, list directory, etc. Like the `file()` method, it can work with local files, remote URLs, and remote object storage. Storage credentials can be provided through the same manner as launching a pipeline (Nextflow config, environment vars, etc).

**Options**

`-h, -help`
: Print the command usage.

**Examples**

List a directory.

```console
$ nextflow fs list <directory>
```

Print the contents of a file to standard output.

```console
$ nextflow fs cat <file>
```

Copy a file or directory.

```console
$ nextflow fs cp <source> <target>
```

Move a file or directory.

```console
$ nextflow fs mv <source> <target>
```

Delete a file or directory.

```console
$ nextflow fs rm <path>
```

:::{versionadded} 23.10.0
:::

Print file or directory attributes.

```console
$ nextflow fs stat <path>
```

### help

Print the top-level help or specific help for a command.
Expand Down
4 changes: 2 additions & 2 deletions modules/nextflow/src/main/groovy/nextflow/cli/CmdFs.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ class CmdFs extends CmdBase implements UsageAware {
private void run0() {
final cmd = findCmd(args[0])
if( !cmd ) {
throw new AbortOperationException("Unknown file system command: `$cmd`")
throw new AbortOperationException("Unknown fs sub-command: `$cmd`")
}

Path target
Expand Down Expand Up @@ -311,7 +311,7 @@ class CmdFs extends CmdBase implements UsageAware {
if( sub )
println sub.usage()
else {
throw new AbortOperationException("Unknown cloud sub-command: ${args[0]}")
throw new AbortOperationException("Unknown fs sub-command: ${args[0]}")
}
}

Expand Down

0 comments on commit 1a68049

Please sign in to comment.