fscli

command
v0.0.0-...-7d77a24 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 23, 2023 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

fscli is an example command-line application that uses go-fsimpl to perform a few basic filesystem operations.

It uses the autofs package to lookup the filesystem implementation for the given base URL, so all URL schemes supported by this module can be used.

Usage

usage: fscli <flags> <command> ...
flags:

  -base-url string
    	Base URL of the filesystem

commands:

  ls [DIR]
    	List the files in DIR. Defaults to '.' (the current directory).
  cat [FILE]...
    	Concatenate FILE(s) to standard output.
  stat [FILE]
    	Print information about FILE to standard output.

Examples

$ fscli -base-url=git+ssh://git@github.com/git-fixtures/basic//json ls
 -rw-r--r-- 212.7KiB 2022-08-21 11:10 long.json
 -rw-r--r--     706B 2022-08-21 11:10 short.json

$ fscli -base-url=file:///tmp cat test.txt test2.txt
this is the content of test.txt
this is the content of test2.txt

$ fscli -base-url=https://example.com stat .
.:
    Size:         648B
    Modified:     2019-10-17T07:18:26Z
    Mode:         -rw-r--r--
    Content-Type: text/html; charset=UTF-8

$ fscli -base-url=file:///tmp stat test.txt
test.txt:
    Size:         32B
    Modified:     2022-08-20T19:08:49Z
    Mode:         -rw-r--r--
    Content-Type: text/plain; charset=utf-8

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL