No description, website, or topics provided.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.gitignore
.goreleaser.yml
Gopkg.toml
README.md
del.go
exec.go
hist.go
list.go
main.go
save.go

README.md

gmd

Overview

simple execute saved command.

Usage

Install

go get github.com/midorigreen/gmd

requirement
peco

Command

Save

% gmd save

register alias

% gmd save
Alias: db_hoge

register command

% gmd save
Alias: db_hoge
Command: mysql -h xxx -u xxx -p

Save from history

% gmd hist

history latest 30

QUERY>                                 IgnoreCase [30 (1/1)]
git mv hsave.go hist.go
vi main.go

register alias

% gmd hist
Alias: main open

Execute

% gmd exec

select alias

QUERY>                                  IgnoreCase [5 (1/1)]
build
db_hoge
..

execute

% gmd exec
[CMD]: mysql -h xxx -u xxx -p
Enter password:

Preview

% gmd list
+---------+------------------------+
|  ALIAS  |        COMMAND         |
+---------+------------------------+
| build   | go build               |
| db_hoge | mysql -h xxx -u xxx -p |
| log     | git log                |
| ls      | ls -l                  |
+---------+------------------------+

Delete

% gmd del [alias]
Success Delete Command: [alias]

Help

NAME:
   gcmd - simple exec saved cmd

USAGE:
   gmd [global options] command [command options] [arguments...]

VERSION:
   v1.0

COMMANDS:
     exec, e  execute saved command
     save, s  saved new command
     hist, h  saved new command from hisory
     list, l  output cmd list
     del, d   delete cmd list
     help, h  Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --help, -h     show help
   --version, -v  print the version

Todo

  • config edit command