cmd

command
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2024 License: MIT Imports: 9 Imported by: 0

README

Command-Line

Package main provides a command-line interface for executing shortcuts defined in a JSON file.

Usage

  • Initializes by loading a JSON file specified in the SHORTCUT environment variable or in the home or current directory, named "shortcut.json".
  • It parses the command-line arguments, retrieves the shortcut specified by the first argument, and executes it with the remaining arguments.

The program is invoked with the name of the shortcut to execute followed by its arguments, if any. If the shortcut is not found, an error message is printed and the program exits with a non-zero status code.

Example

shortcut.json

{
  "ssh": {
    "name": "ssh",
    "args": [
      "root@%s"
    ],
    "n": 1
  }
}

run

sc ssh 127.0.0.1

equal run

ssh root@127.0.0.1

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

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