From 87d61693b1f79bb12d8aaa1f4eb76cceb13b258f Mon Sep 17 00:00:00 2001 From: LeeW Date: Sun, 6 Sep 2015 19:58:17 +0800 Subject: [PATCH 01/24] Merge gi_extension project into git extras as git-ignore-io * gi_extension(https://github.com/Lee-W/gi_extension) --- bin/git-ignore-io | 119 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 119 insertions(+) create mode 100644 bin/git-ignore-io diff --git a/bin/git-ignore-io b/bin/git-ignore-io new file mode 100644 index 000000000..a444b69b6 --- /dev/null +++ b/bin/git-ignore-io @@ -0,0 +1,119 @@ +#/bin/sh + +gitignore_io_url="https://www.gitignore.io/api/" + +default_path="$HOME/.gi_list" +gi_list=`cat $default_path | tr "," "\n"` + +update_gi_list() { + curl -L -s "${gitignore_io_url}/list" > ~/.gi_list +} + +print_in_alphabetical_order() { + for i in {a..z}; + do + echo "$gi_list" | grep "^$i" | tr "\n" " " + echo + done +} + +print_in_table_format() { + table_width=5 + coulumn_width=25 + + counter=0 + for item in $gi_list; do + printf "%-${coulumn_width}s" $item + counter=$(($counter+1)) + if [[ $(($counter%$table_width)) -eq 0 ]]; then + echo + fi + done + echo +} + +print_last_modified_time() { + local gi_list_date=`stat -f "%t%Sm" $default_path` + echo "Last update time: $gi_list_date" +} + +gi() { + curl -L -s $gitignore_io_url/$1 +} + +gi_export() { + gi $1 > .gitignore +} + +gi_append() { + gi $1 >> .gitignore +} + +show_usage() { + echo "usage: gi " + echo " [-a| -e] " + echo " [-u| -t| -l| -L]" + echo " [-h]" +} + +print_help_message() { + echo "-a [types] apeend new .gitignore content to .gitignore under the current directory" + echo "-e [types] export new .gitignore to the current directory (The old one will be replaced.)" + echo "-L print ~/.gi_list in alphabetical order" + echo "-l print ~/.gi_list in table format" + echo "-u update ~/.gi_list" + echo "-t show the last modified time of ~/.gi_list" + echo "-h show help" +} + + +update_gi_list & +if [[ $# -eq 0 ]]; then + show_usage +else + case $1 in + -a|-e) + opt=$1 + shift + if [[ $# -eq 0 ]]; then + show_usage + exit + fi + + gi_to_curl=`echo $@ | tr " " ","` + case $opt in + -a) + gi_append $gi_to_curl + ;; + -e) + gi_export $gi_to_curl + ;; + esac + + exit + ;; + -t) + print_last_modified_time + ;; + -u) + update_gi_list + ;; + -L) + print_in_alphabetical_order + ;; + -l) + print_in_table_format + ;; + -h) + print_help_message + ;; + -*) + echo No Such option + show_usage + ;; + *) + gi_to_curl=`echo $@ | tr " " ","` + gi $gi_to_curl + ;; + esac +fi From 37aacf3e41d529ee3b48a5c01bf4effcf0e354eb Mon Sep 17 00:00:00 2001 From: LeeW Date: Sun, 6 Sep 2015 20:01:34 +0800 Subject: [PATCH 02/24] Init gitignore and ignore vim osx temp files --- .gitignore | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..502963ffb --- /dev/null +++ b/.gitignore @@ -0,0 +1,37 @@ +# Created by https://www.gitignore.io/api/vim,osx + +### Vim ### +[._]*.s[a-w][a-z] +[._]s[a-w][a-z] +*.un~ +Session.vim +.netrwhist +*~ + + +### OSX ### +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + From d87599c344600e6f925f5d4041e09cfe2f244e05 Mon Sep 17 00:00:00 2001 From: LeeW Date: Sun, 6 Sep 2015 22:18:29 +0800 Subject: [PATCH 03/24] Remove help from git-ignore-io --- bin/git-ignore-io | 35 +++++++++++++---------------------- 1 file changed, 13 insertions(+), 22 deletions(-) mode change 100644 => 100755 bin/git-ignore-io diff --git a/bin/git-ignore-io b/bin/git-ignore-io old mode 100644 new mode 100755 index a444b69b6..18d235361 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -50,20 +50,14 @@ gi_append() { } show_usage() { - echo "usage: gi " - echo " [-a| -e] " - echo " [-u| -t| -l| -L]" - echo " [-h]" -} - -print_help_message() { - echo "-a [types] apeend new .gitignore content to .gitignore under the current directory" - echo "-e [types] export new .gitignore to the current directory (The old one will be replaced.)" - echo "-L print ~/.gi_list in alphabetical order" - echo "-l print ~/.gi_list in table format" - echo "-u update ~/.gi_list" - echo "-t show the last modified time of ~/.gi_list" - echo "-h show help" + echo "Usage:" + echo " git ignore-io ... Show gitignore template" + echo " [-a|--append] ... Apeend new .gitignore content to .gitignore under the current directory" + echo " [-e|--export] ... Export new .gitignore to the current directory (The old one will be replaced)" + echo " [-l] Print available types in alphabetical order " + echo " [-L] Print available types in table format" + echo " [-t|--show-update-time] Show the last modified time of ~/.gi_list (where the list of available types stored)" + echo " [-u|--update-list] Update ~/.gi_list" } @@ -72,7 +66,7 @@ if [[ $# -eq 0 ]]; then show_usage else case $1 in - -a|-e) + -a|--append|-e|--export) opt=$1 shift if [[ $# -eq 0 ]]; then @@ -82,20 +76,20 @@ else gi_to_curl=`echo $@ | tr " " ","` case $opt in - -a) + -a|--append) gi_append $gi_to_curl ;; - -e) + -e|--export) gi_export $gi_to_curl ;; esac exit ;; - -t) + -t|--show-update-time) print_last_modified_time ;; - -u) + -u|--update-list) update_gi_list ;; -L) @@ -104,9 +98,6 @@ else -l) print_in_table_format ;; - -h) - print_help_message - ;; -*) echo No Such option show_usage From 4a8037fa6224fc96b935ac6f7871ea67c9593190 Mon Sep 17 00:00:00 2001 From: LeeW Date: Sun, 6 Sep 2015 22:49:32 +0800 Subject: [PATCH 04/24] Implement search function or git-ignore-io --- bin/git-ignore-io | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/bin/git-ignore-io b/bin/git-ignore-io index 18d235361..404e227b5 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -32,6 +32,16 @@ print_in_table_format() { echo } +search() { + for type in $gi_list; + do + if [[ $type == *$1* ]] + then + echo $type + fi + done +} + print_last_modified_time() { local gi_list_date=`stat -f "%t%Sm" $default_path` echo "Last update time: $gi_list_date" @@ -56,6 +66,7 @@ show_usage() { echo " [-e|--export] ... Export new .gitignore to the current directory (The old one will be replaced)" echo " [-l] Print available types in alphabetical order " echo " [-L] Print available types in table format" + echo " [-s|--search] Search word in available types" echo " [-t|--show-update-time] Show the last modified time of ~/.gi_list (where the list of available types stored)" echo " [-u|--update-list] Update ~/.gi_list" } @@ -92,6 +103,9 @@ else -u|--update-list) update_gi_list ;; + -s|--search) + search $2 + ;; -L) print_in_alphabetical_order ;; From a1d0445cc1bfb34960d8530c46a99185dddd4040 Mon Sep 17 00:00:00 2001 From: LeeW Date: Mon, 7 Sep 2015 21:41:59 +0800 Subject: [PATCH 05/24] Add description to Commands.md for git-ignore-io --- Commands.md | 49 +++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 49 insertions(+) diff --git a/Commands.md b/Commands.md index bda485a67..13a5b0f71 100644 --- a/Commands.md +++ b/Commands.md @@ -20,6 +20,7 @@ - [`git graft`](#git-graft) - [`git alias`](#git-alias) - [`git ignore`](#git-ignore) + - [`git ignore-io`](#git-ignore-io) - [`git info`](#git-info) - [`git fork`](#git-fork) - [`git release`](#git-release) @@ -408,6 +409,54 @@ build *.log ``` +## git ignore-io + +Generate sample gitignore file from [gitignore.io](https://www.gitignore.io) + +Without option, `git ignore` show the sample gitignore on screen. + +```bash +$ git ignore-io vim + + # Created by https://www.gitignore.io/api/vim + + ### Vim ### + [._]*.s[a-w][a-z] + [._]s[a-w][a-z] + *.un~ + Session.vim + .netrwhist + *~ +``` + +To export it to `.gitignore` file you can use the following options: + +* `-a` or `--append` to append the result to `.gitignore` +* `-e` or `--export` to replace `.gitignore` with the result + +```bash +$ git ignore-io vim python +``` + +For efficiency, `git ignore-io` store all available typess at `~/.gi_list`. +To list all the available types: + +* `-l` or `-L` : These two options will show the list in different format. Just try it. + +You can also search type from the list by: + +* `-s ` or `--search ` + +```bash +$ git ignore-io -s ja + + django + jabref + java + ninja +``` + + ## git info Show information about the repo: From 98bbfe7968a369566959a18c49db29c42050f2c9 Mon Sep 17 00:00:00 2001 From: LeeW Date: Mon, 7 Sep 2015 22:20:20 +0800 Subject: [PATCH 06/24] Fix typo --- bin/git-ignore-io | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-ignore-io b/bin/git-ignore-io index 404e227b5..4c475df1b 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -62,7 +62,7 @@ gi_append() { show_usage() { echo "Usage:" echo " git ignore-io ... Show gitignore template" - echo " [-a|--append] ... Apeend new .gitignore content to .gitignore under the current directory" + echo " [-a|--append] ... Append new .gitignore content to .gitignore under the current directory" echo " [-e|--export] ... Export new .gitignore to the current directory (The old one will be replaced)" echo " [-l] Print available types in alphabetical order " echo " [-L] Print available types in table format" From 2ced182fccae93849e00ecdf2f6b76d25beaba2b Mon Sep 17 00:00:00 2001 From: LeeW Date: Mon, 7 Sep 2015 22:24:40 +0800 Subject: [PATCH 07/24] Finish manual for git-ignore-io --- man/git-ignore-io.md | 77 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 77 insertions(+) create mode 100644 man/git-ignore-io.md diff --git a/man/git-ignore-io.md b/man/git-ignore-io.md new file mode 100644 index 000000000..62ebf5d64 --- /dev/null +++ b/man/git-ignore-io.md @@ -0,0 +1,77 @@ +git-ignore-io(1) -- Get sample gitignore file +================================ + +## SYNOPSIS + +`git ignore-io` [OPTIONS] + +## DESCRIPTION +Get sample gitignore file from [gitignore.io]("https://www.gitignore.io") + +## OPTIONS + +[-a|--append] ... Append new .gitignore content to .gitignore under the current directory +[-e|--export] ... Export new .gitignore to the current directory (The old one will be replaced) +[-l] Print available types in alphabetical order +[-L] Print available types in table format +[-s|--search] Search word in available types +[-t|--show-update-time] Show the last modified time of ~/.gi\_list (where the list of available types stored) +[-u|--update-list] Update ~/.gi\_list + +## EXAMPLES +Show sample gitignore file for vim + +```bash +$ git ignore-io vim + + # Created by https://www.gitignore.io/api/vim + + ### Vim ### + [._]*.s[a-w][a-z] + [._]s[a-w][a-z] + *.un~ + Session.vim + .netrwhist + *~ +``` + +Append sample gitignore for vim and python to .gitignore in current directory. + +```bash +$ git ignore-io -a vim python +``` + +Show all available types + +```bash +$ git ignore-io -l + + actionscript ada agda android anjuta + appceleratortitanium appcode appengine archives archlinuxpackages + autotools basercms bazel bluej bower + bricxcc c c++ cakephp carthage + ...... +``` + +Search ja in all available types + +```bash +$ git ignore-io -s ja + + django + jabref + java + ninja +``` + + +## AUTHOR + +Written by Lee-W +## REPORTING BUGS + +<> + +## SEE ALSO + +<> From 967b51c96437387b81bd2a678588dca54318834a Mon Sep 17 00:00:00 2001 From: LeeW Date: Mon, 7 Sep 2015 22:37:56 +0800 Subject: [PATCH 08/24] Generate manual using ronn for git-ignore-io --- man/git-ignore-io.1 | 116 ++++++++++++++++++++++++++++ man/git-ignore-io.1.html | 159 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 275 insertions(+) create mode 100644 man/git-ignore-io.1 create mode 100644 man/git-ignore-io.1.html diff --git a/man/git-ignore-io.1 b/man/git-ignore-io.1 new file mode 100644 index 000000000..33224c062 --- /dev/null +++ b/man/git-ignore-io.1 @@ -0,0 +1,116 @@ +.\" generated with Ronn/v0.7.3 +.\" http://github.com/rtomayko/ronn/tree/0.7.3 +. +.TH "GIT\-IGNORE\-IO" "1" "September 2015" "" "" +. +.SH "NAME" +\fBgit\-ignore\-io\fR \- Get sample gitignore file +. +.SH "SYNOPSIS" +\fBgit ignore\-io\fR \fIOPTIONS\fR +. +.SH "DESCRIPTION" +Get sample gitignore file from gitignore\.io \fI\fR +. +.SH "OPTIONS" +[\-a|\-\-append] \fItypes\fR\.\.\. Append new \.gitignore content to \.gitignore under the current directory +. +.br +[\-e|\-\-export] \fItypes\fR\.\.\. Export new \.gitignore to the current directory (The old one will be replaced) +. +.br +[\-l] Print available types in alphabetical order +. +.br +[\-L] Print available types in table format +. +.br +[\-s|\-\-search] \fIword\fR Search word in available types +. +.br +[\-t|\-\-show\-update\-time] Show the last modified time of ~/\.gi_list (where the list of available types stored) +. +.br +[\-u|\-\-update\-list] Update ~/\.gi_list +. +.SH "EXAMPLES" +Show sample gitignore file for vim +. +.IP "" 4 +. +.nf + +$ git ignore\-io vim + + # Created by https://www\.gitignore\.io/api/vim + + ### Vim ### + [\._]*\.s[a\-w][a\-z] + [\._]s[a\-w][a\-z] + *\.un~ + Session\.vim + \.netrwhist + *~ +. +.fi +. +.IP "" 0 +. +.P +Append sample gitignore for vim and python to \.gitignore in current directory\. +. +.IP "" 4 +. +.nf + +$ git ignore\-io \-a vim python +. +.fi +. +.IP "" 0 +. +.P +Show all available types +. +.IP "" 4 +. +.nf + +$ git ignore\-io \-l + + actionscript ada agda android anjuta + appceleratortitanium appcode appengine archives archlinuxpackages + autotools basercms bazel bluej bower + bricxcc c c++ cakephp carthage + \.\.\.\.\.\. +. +.fi +. +.IP "" 0 +. +.P +Search ja in all available types +. +.IP "" 4 +. +.nf + +$ git ignore\-io \-s ja + + django + jabref + java + ninja +. +.fi +. +.IP "" 0 +. +.SH "AUTHOR" +Written by Lee\-W \fIcl87654321@gmail\.com\fR +. +.SH "REPORTING BUGS" +<\fIhttps://github\.com/tj/git\-extras/issues\fR> +. +.SH "SEE ALSO" +<\fIhttps://github\.com/tj/git\-extras\fR> diff --git a/man/git-ignore-io.1.html b/man/git-ignore-io.1.html new file mode 100644 index 000000000..4dc974b27 --- /dev/null +++ b/man/git-ignore-io.1.html @@ -0,0 +1,159 @@ + + + + + + git-ignore-io(1) - Get sample gitignore file + + + + +
+ + + +
    +
  1. git-ignore-io(1)
  2. +
  3. +
  4. git-ignore-io(1)
  5. +
+ +

NAME

+

+ git-ignore-io - Get sample gitignore file +

+ +

SYNOPSIS

+ +

git ignore-io OPTIONS

+ +

DESCRIPTION

+ +

Get sample gitignore file from gitignore.io

+ +

OPTIONS

+ +

[-a|--append] types... Append new .gitignore content to .gitignore under the current directory
+[-e|--export] types... Export new .gitignore to the current directory (The old one will be replaced)
+[-l] Print available types in alphabetical order
+[-L] Print available types in table format
+[-s|--search] word Search word in available types
+[-t|--show-update-time] Show the last modified time of ~/.gi_list (where the list of available types stored)
+[-u|--update-list] Update ~/.gi_list

+ +

EXAMPLES

+ +

Show sample gitignore file for vim

+ +
$ git ignore-io vim
+
+    # Created by https://www.gitignore.io/api/vim
+
+    ### Vim ###
+    [._]*.s[a-w][a-z]
+    [._]s[a-w][a-z]
+    *.un~
+    Session.vim
+    .netrwhist
+    *~
+
+ +

Append sample gitignore for vim and python to .gitignore in current directory.

+ +
$ git ignore-io -a vim python
+
+ +

Show all available types

+ +
$ git ignore-io -l
+
+    actionscript             ada                      agda                     android                  anjuta
+    appceleratortitanium     appcode                  appengine                archives                 archlinuxpackages
+    autotools                basercms                 bazel                    bluej                    bower
+    bricxcc                  c                        c++                      cakephp                  carthage
+    ......
+
+ +

Search ja in all available types

+ +
$ git ignore-io -s ja
+
+    django
+    jabref
+    java
+    ninja
+
+ +

AUTHOR

+ +

Written by Lee-W cl87654321@gmail.com

+ +

REPORTING BUGS

+ +

<https://github.com/tj/git-extras/issues>

+ +

SEE ALSO

+ +

<https://github.com/tj/git-extras>

+ + +
    +
  1. +
  2. September 2015
  3. +
  4. git-ignore-io(1)
  5. +
+ +
+ + From ccd53030402fffa158ee6700a139e2747fa19a6c Mon Sep 17 00:00:00 2001 From: LeeW Date: Tue, 8 Sep 2015 19:42:20 +0800 Subject: [PATCH 09/24] Update manual and description in Commands --- Commands.md | 2 +- man/git-ignore-io.1 | 2 +- man/git-ignore-io.1.html | 4 ++-- man/git-ignore-io.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Commands.md b/Commands.md index 13a5b0f71..b8622826d 100644 --- a/Commands.md +++ b/Commands.md @@ -413,7 +413,7 @@ build Generate sample gitignore file from [gitignore.io](https://www.gitignore.io) -Without option, `git ignore` show the sample gitignore on screen. +Without option, `git ignore-io ` shows the sample gitignore of specified types on screen. ```bash $ git ignore-io vim diff --git a/man/git-ignore-io.1 b/man/git-ignore-io.1 index 33224c062..6ecc05513 100644 --- a/man/git-ignore-io.1 +++ b/man/git-ignore-io.1 @@ -10,7 +10,7 @@ \fBgit ignore\-io\fR \fIOPTIONS\fR . .SH "DESCRIPTION" -Get sample gitignore file from gitignore\.io \fI\fR +Get sample gitignore file from gitignore\.io \fIhttps://www\.gitignore\.io\fR . .SH "OPTIONS" [\-a|\-\-append] \fItypes\fR\.\.\. Append new \.gitignore content to \.gitignore under the current directory diff --git a/man/git-ignore-io.1.html b/man/git-ignore-io.1.html index 4dc974b27..ce8d9947a 100644 --- a/man/git-ignore-io.1.html +++ b/man/git-ignore-io.1.html @@ -80,7 +80,7 @@

SYNOPSIS

DESCRIPTION

-

Get sample gitignore file from gitignore.io

+

Get sample gitignore file from gitignore.io

OPTIONS

@@ -137,7 +137,7 @@

EXAMPLES

AUTHOR

-

Written by Lee-W cl87654321@gmail.com

+

Written by Lee-W cl87654321@gmail.com

REPORTING BUGS

diff --git a/man/git-ignore-io.md b/man/git-ignore-io.md index 62ebf5d64..6a68106cc 100644 --- a/man/git-ignore-io.md +++ b/man/git-ignore-io.md @@ -6,7 +6,7 @@ git-ignore-io(1) -- Get sample gitignore file `git ignore-io` [OPTIONS] ## DESCRIPTION -Get sample gitignore file from [gitignore.io]("https://www.gitignore.io") +Get sample gitignore file from [gitignore.io](https://www.gitignore.io) ## OPTIONS From 3ad2f6fa4aa7626d180b1bac8ad730f40cacbf16 Mon Sep 17 00:00:00 2001 From: LeeW Date: Tue, 8 Sep 2015 20:23:53 +0800 Subject: [PATCH 10/24] Refactor git-ignore-io and remove .gitignore --- .gitignore | 37 ------------------------------------- bin/git-ignore-io | 16 +++------------- 2 files changed, 3 insertions(+), 50 deletions(-) delete mode 100644 .gitignore diff --git a/.gitignore b/.gitignore deleted file mode 100644 index 502963ffb..000000000 --- a/.gitignore +++ /dev/null @@ -1,37 +0,0 @@ -# Created by https://www.gitignore.io/api/vim,osx - -### Vim ### -[._]*.s[a-w][a-z] -[._]s[a-w][a-z] -*.un~ -Session.vim -.netrwhist -*~ - - -### OSX ### -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - diff --git a/bin/git-ignore-io b/bin/git-ignore-io index 4c475df1b..728b7000a 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -1,9 +1,9 @@ -#/bin/sh +#!/usr/bin/env bash gitignore_io_url="https://www.gitignore.io/api/" default_path="$HOME/.gi_list" -gi_list=`cat $default_path | tr "," "\n"` +gi_list=`cat $default_path | tr "," "\n\n"` update_gi_list() { curl -L -s "${gitignore_io_url}/list" > ~/.gi_list @@ -19,17 +19,7 @@ print_in_alphabetical_order() { print_in_table_format() { table_width=5 - coulumn_width=25 - - counter=0 - for item in $gi_list; do - printf "%-${coulumn_width}s" $item - counter=$(($counter+1)) - if [[ $(($counter%$table_width)) -eq 0 ]]; then - echo - fi - done - echo + echo "$gi_list" | xargs -n $table_width | column -t } search() { From fed97bf8db8e364228baf27cc813bb9c03f77ba5 Mon Sep 17 00:00:00 2001 From: LeeW Date: Tue, 8 Sep 2015 20:50:38 +0800 Subject: [PATCH 11/24] Not to update list each time git-ignore-io is executed * Check whether the list exists. If not, get it. * Update should use -u option manually --- bin/git-ignore-io | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/bin/git-ignore-io b/bin/git-ignore-io index 728b7000a..e6510e8ac 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -62,7 +62,13 @@ show_usage() { } -update_gi_list & +check_list_exist() { + if ! [ -f $default_path ]; then + update_gi_list & + fi +} + +check_list_exist if [[ $# -eq 0 ]]; then show_usage else From 60735946566c64fc238b035bb813278c802f89db Mon Sep 17 00:00:00 2001 From: LeeW Date: Tue, 8 Sep 2015 20:59:08 +0800 Subject: [PATCH 12/24] Remove redundant \n in tr --- bin/git-ignore-io | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-ignore-io b/bin/git-ignore-io index e6510e8ac..5a18340dd 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -3,7 +3,7 @@ gitignore_io_url="https://www.gitignore.io/api/" default_path="$HOME/.gi_list" -gi_list=`cat $default_path | tr "," "\n\n"` +gi_list=`cat $default_path | tr "," "\n"` update_gi_list() { curl -L -s "${gitignore_io_url}/list" > ~/.gi_list From 469434a8eb65b6091d790ea8abf69a04eabeffe0 Mon Sep 17 00:00:00 2001 From: LeeW Date: Tue, 8 Sep 2015 21:01:20 +0800 Subject: [PATCH 13/24] Fix doc error for git-ignore-io --- man/git-ignore-io.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/man/git-ignore-io.md b/man/git-ignore-io.md index 6a68106cc..25df1b67d 100644 --- a/man/git-ignore-io.md +++ b/man/git-ignore-io.md @@ -12,8 +12,8 @@ Get sample gitignore file from [gitignore.io](https://www.gitignore.io) [-a|--append] ... Append new .gitignore content to .gitignore under the current directory [-e|--export] ... Export new .gitignore to the current directory (The old one will be replaced) -[-l] Print available types in alphabetical order -[-L] Print available types in table format +[-L] Print available types in alphabetical order +[-l] Print available types in table format [-s|--search] Search word in available types [-t|--show-update-time] Show the last modified time of ~/.gi\_list (where the list of available types stored) [-u|--update-list] Update ~/.gi\_list From b988558ea41010e5bc2d5b8f040caa9ddc41b5ec Mon Sep 17 00:00:00 2001 From: LeeW Date: Tue, 8 Sep 2015 21:04:13 +0800 Subject: [PATCH 14/24] Fix doc error for git-ignore-io --- man/git-ignore-io.1 | 4 ++-- man/git-ignore-io.1.html | 6 +++--- man/git-ignore-io.md | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/man/git-ignore-io.1 b/man/git-ignore-io.1 index 6ecc05513..e0844c08e 100644 --- a/man/git-ignore-io.1 +++ b/man/git-ignore-io.1 @@ -19,10 +19,10 @@ Get sample gitignore file from gitignore\.io \fIhttps://www\.gitignore\.io\fR [\-e|\-\-export] \fItypes\fR\.\.\. Export new \.gitignore to the current directory (The old one will be replaced) . .br -[\-l] Print available types in alphabetical order +[\-L] Print available types in alphabetical order . .br -[\-L] Print available types in table format +[\-l] Print available types in table format . .br [\-s|\-\-search] \fIword\fR Search word in available types diff --git a/man/git-ignore-io.1.html b/man/git-ignore-io.1.html index ce8d9947a..de879371c 100644 --- a/man/git-ignore-io.1.html +++ b/man/git-ignore-io.1.html @@ -86,8 +86,8 @@

OPTIONS

[-a|--append] types... Append new .gitignore content to .gitignore under the current directory
[-e|--export] types... Export new .gitignore to the current directory (The old one will be replaced)
-[-l] Print available types in alphabetical order
-[-L] Print available types in table format
+[-L] Print available types in alphabetical order
+[-l] Print available types in table format
[-s|--search] word Search word in available types
[-t|--show-update-time] Show the last modified time of ~/.gi_list (where the list of available types stored)
[-u|--update-list] Update ~/.gi_list

@@ -137,7 +137,7 @@

EXAMPLES

AUTHOR

-

Written by Lee-W cl87654321@gmail.com

+

Written by Lee-W cl87654321@gmail.com

REPORTING BUGS

diff --git a/man/git-ignore-io.md b/man/git-ignore-io.md index 6a68106cc..25df1b67d 100644 --- a/man/git-ignore-io.md +++ b/man/git-ignore-io.md @@ -12,8 +12,8 @@ Get sample gitignore file from [gitignore.io](https://www.gitignore.io) [-a|--append] ... Append new .gitignore content to .gitignore under the current directory [-e|--export] ... Export new .gitignore to the current directory (The old one will be replaced) -[-l] Print available types in alphabetical order -[-L] Print available types in table format +[-L] Print available types in alphabetical order +[-l] Print available types in table format [-s|--search] Search word in available types [-t|--show-update-time] Show the last modified time of ~/.gi\_list (where the list of available types stored) [-u|--update-list] Update ~/.gi\_list From 2c1d76664008a01410ec3d47b13c3b6b777ca99d Mon Sep 17 00:00:00 2001 From: LeeW Date: Wed, 9 Sep 2015 18:42:28 +0800 Subject: [PATCH 15/24] Modify print_last_modified_time to make it Linux compatible --- bin/git-ignore-io | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bin/git-ignore-io b/bin/git-ignore-io index 5a18340dd..203d5475d 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -33,7 +33,14 @@ search() { } print_last_modified_time() { - local gi_list_date=`stat -f "%t%Sm" $default_path` + gi_list_date=$(stat -c "%y" "$default_path" 2> /dev/null) + if [ "$?" -ne 0 ]; then + gi_list_date=$(stat -f "%t%Sm" "$default_path" 2> /dev/null) + if [ "$?" -ne 0 ]; then + gi_list_date=$(date -r "$default_path" +%s 2> /dev/null) + [ "$?" -ne 0 ] && gi_list_date=0 + fi + fi echo "Last update time: $gi_list_date" } From 0393d560f84fe652f952089870d82740cb78820c Mon Sep 17 00:00:00 2001 From: LeeW Date: Sat, 12 Sep 2015 08:04:47 +0800 Subject: [PATCH 16/24] Fix usage error --- bin/git-ignore-io | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/git-ignore-io b/bin/git-ignore-io index 203d5475d..ac584d47c 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -61,8 +61,8 @@ show_usage() { echo " git ignore-io ... Show gitignore template" echo " [-a|--append] ... Append new .gitignore content to .gitignore under the current directory" echo " [-e|--export] ... Export new .gitignore to the current directory (The old one will be replaced)" - echo " [-l] Print available types in alphabetical order " - echo " [-L] Print available types in table format" + echo " [-l] Print available types in table format" + echo " [-L] Print available types in alphabetical order " echo " [-s|--search] Search word in available types" echo " [-t|--show-update-time] Show the last modified time of ~/.gi_list (where the list of available types stored)" echo " [-u|--update-list] Update ~/.gi_list" From 490d12b6f70129d857f3fa9692563635ab7cb849 Mon Sep 17 00:00:00 2001 From: LeeW Date: Sat, 12 Sep 2015 08:15:12 +0800 Subject: [PATCH 17/24] Add full name for list option --- bin/git-ignore-io | 8 ++++---- man/git-ignore-io.1 | 4 ++-- man/git-ignore-io.1.html | 6 +++--- man/git-ignore-io.md | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/bin/git-ignore-io b/bin/git-ignore-io index ac584d47c..5aa3fd6ad 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -61,8 +61,8 @@ show_usage() { echo " git ignore-io ... Show gitignore template" echo " [-a|--append] ... Append new .gitignore content to .gitignore under the current directory" echo " [-e|--export] ... Export new .gitignore to the current directory (The old one will be replaced)" - echo " [-l] Print available types in table format" - echo " [-L] Print available types in alphabetical order " + echo " [-l|--list-in-table] Print available types in table format" + echo " [-L|--list-alphabetically] Print available types in alphabetical order " echo " [-s|--search] Search word in available types" echo " [-t|--show-update-time] Show the last modified time of ~/.gi_list (where the list of available types stored)" echo " [-u|--update-list] Update ~/.gi_list" @@ -109,10 +109,10 @@ else -s|--search) search $2 ;; - -L) + -L|--list-alphabetically) print_in_alphabetical_order ;; - -l) + -l|--list-in-table) print_in_table_format ;; -*) diff --git a/man/git-ignore-io.1 b/man/git-ignore-io.1 index e0844c08e..13144a78d 100644 --- a/man/git-ignore-io.1 +++ b/man/git-ignore-io.1 @@ -19,10 +19,10 @@ Get sample gitignore file from gitignore\.io \fIhttps://www\.gitignore\.io\fR [\-e|\-\-export] \fItypes\fR\.\.\. Export new \.gitignore to the current directory (The old one will be replaced) . .br -[\-L] Print available types in alphabetical order +[\-l|\-\-list\-in\-table] Print available types in table format . .br -[\-l] Print available types in table format +[\-L|\-\-list\-alphabetically] Print available types in alphabetical order . .br [\-s|\-\-search] \fIword\fR Search word in available types diff --git a/man/git-ignore-io.1.html b/man/git-ignore-io.1.html index de879371c..8da04c067 100644 --- a/man/git-ignore-io.1.html +++ b/man/git-ignore-io.1.html @@ -86,8 +86,8 @@

OPTIONS

[-a|--append] types... Append new .gitignore content to .gitignore under the current directory
[-e|--export] types... Export new .gitignore to the current directory (The old one will be replaced)
-[-L] Print available types in alphabetical order
-[-l] Print available types in table format
+[-l|--list-in-table] Print available types in table format
+[-L|--list-alphabetically] Print available types in alphabetical order
[-s|--search] word Search word in available types
[-t|--show-update-time] Show the last modified time of ~/.gi_list (where the list of available types stored)
[-u|--update-list] Update ~/.gi_list

@@ -137,7 +137,7 @@

EXAMPLES

AUTHOR

-

Written by Lee-W cl87654321@gmail.com

+

Written by Lee-W cl87654321@gmail.com

REPORTING BUGS

diff --git a/man/git-ignore-io.md b/man/git-ignore-io.md index 25df1b67d..ca83cfadb 100644 --- a/man/git-ignore-io.md +++ b/man/git-ignore-io.md @@ -12,8 +12,8 @@ Get sample gitignore file from [gitignore.io](https://www.gitignore.io) [-a|--append] ... Append new .gitignore content to .gitignore under the current directory [-e|--export] ... Export new .gitignore to the current directory (The old one will be replaced) -[-L] Print available types in alphabetical order -[-l] Print available types in table format +[-l|--list-in-table] Print available types in table format +[-L|--list-alphabetically] Print available types in alphabetical order [-s|--search] Search word in available types [-t|--show-update-time] Show the last modified time of ~/.gi\_list (where the list of available types stored) [-u|--update-list] Update ~/.gi\_list From 61bfc44eec5684296377ef1881ee4b4779a20f84 Mon Sep 17 00:00:00 2001 From: LeeW Date: Thu, 17 Sep 2015 21:19:45 +0800 Subject: [PATCH 18/24] Fix ~/.gi_list not exist problem --- bin/git-ignore-io | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/bin/git-ignore-io b/bin/git-ignore-io index 5aa3fd6ad..86ad885e7 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -1,9 +1,7 @@ #!/usr/bin/env bash gitignore_io_url="https://www.gitignore.io/api/" - default_path="$HOME/.gi_list" -gi_list=`cat $default_path | tr "," "\n"` update_gi_list() { curl -L -s "${gitignore_io_url}/list" > ~/.gi_list @@ -25,9 +23,9 @@ print_in_table_format() { search() { for type in $gi_list; do - if [[ $type == *$1* ]] + if [[ "$type" == *$1* ]] then - echo $type + echo "$type" fi done } @@ -45,15 +43,15 @@ print_last_modified_time() { } gi() { - curl -L -s $gitignore_io_url/$1 + curl -L -s $gitignore_io_url/"$1" } gi_export() { - gi $1 > .gitignore + gi "$1" > .gitignore } gi_append() { - gi $1 >> .gitignore + gi "$1" >> .gitignore } show_usage() { @@ -70,9 +68,13 @@ show_usage() { check_list_exist() { - if ! [ -f $default_path ]; then + if ! [ -f "$default_path" ]; then + echo "-----Initial gitignore.io list----" update_gi_list & + echo "-----Save to $default_path-----" + echo fi + gi_list=$(tr "," "\n" < "$default_path" 2>/dev/null) } check_list_exist @@ -88,13 +90,13 @@ else exit fi - gi_to_curl=`echo $@ | tr " " ","` + gi_to_curl=$(echo "$@" | tr " " ",") case $opt in -a|--append) - gi_append $gi_to_curl + gi_append "$gi_to_curl" ;; -e|--export) - gi_export $gi_to_curl + gi_export "$gi_to_curl" ;; esac @@ -107,7 +109,7 @@ else update_gi_list ;; -s|--search) - search $2 + search "$2" ;; -L|--list-alphabetically) print_in_alphabetical_order @@ -120,8 +122,8 @@ else show_usage ;; *) - gi_to_curl=`echo $@ | tr " " ","` - gi $gi_to_curl + gi_to_curl=$(echo "$@" | tr " " ",") + gi "$gi_to_curl" ;; esac fi From 8d0eae5c7faec219d85829e1d8b9a11267c1602a Mon Sep 17 00:00:00 2001 From: LeeW Date: Thu, 17 Sep 2015 21:32:10 +0800 Subject: [PATCH 19/24] Add warning when there is not argument after search, append and export --- bin/git-ignore-io | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/bin/git-ignore-io b/bin/git-ignore-io index 86ad885e7..889f9f4b5 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -86,6 +86,8 @@ else opt=$1 shift if [[ $# -eq 0 ]]; then + echo "There should be at least one type!!!" + echo show_usage exit fi @@ -108,7 +110,15 @@ else -u|--update-list) update_gi_list ;; - -s|--search) + -s|--search) + opt=$1 + shift + if [[ $# -eq 0 ]]; then + echo "There should be one word to be searched!!!" + echo + show_usage + exit + fi search "$2" ;; -L|--list-alphabetically) From b517022e1582b74deae00c3bdd36a3bc032cfd48 Mon Sep 17 00:00:00 2001 From: LeeW Date: Sat, 19 Sep 2015 00:37:38 +0800 Subject: [PATCH 20/24] Fix typo --- bin/git-ignore-io | 2 +- man/git-ignore-io.1 | 2 +- man/git-ignore-io.1.html | 4 ++-- man/git-ignore-io.md | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/bin/git-ignore-io b/bin/git-ignore-io index 889f9f4b5..1ddc222d4 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -62,7 +62,7 @@ show_usage() { echo " [-l|--list-in-table] Print available types in table format" echo " [-L|--list-alphabetically] Print available types in alphabetical order " echo " [-s|--search] Search word in available types" - echo " [-t|--show-update-time] Show the last modified time of ~/.gi_list (where the list of available types stored)" + echo " [-t|--show-update-time] Show the last modified time of ~/.gi_list (where the list of available types is stored)" echo " [-u|--update-list] Update ~/.gi_list" } diff --git a/man/git-ignore-io.1 b/man/git-ignore-io.1 index 13144a78d..9ca855bc8 100644 --- a/man/git-ignore-io.1 +++ b/man/git-ignore-io.1 @@ -28,7 +28,7 @@ Get sample gitignore file from gitignore\.io \fIhttps://www\.gitignore\.io\fR [\-s|\-\-search] \fIword\fR Search word in available types . .br -[\-t|\-\-show\-update\-time] Show the last modified time of ~/\.gi_list (where the list of available types stored) +[\-t|\-\-show\-update\-time] Show the last modified time of ~/\.gi_list (where the list of available types is stored) . .br [\-u|\-\-update\-list] Update ~/\.gi_list diff --git a/man/git-ignore-io.1.html b/man/git-ignore-io.1.html index 8da04c067..47832b508 100644 --- a/man/git-ignore-io.1.html +++ b/man/git-ignore-io.1.html @@ -89,7 +89,7 @@

OPTIONS

[-l|--list-in-table] Print available types in table format
[-L|--list-alphabetically] Print available types in alphabetical order
[-s|--search] word Search word in available types
-[-t|--show-update-time] Show the last modified time of ~/.gi_list (where the list of available types stored)
+[-t|--show-update-time] Show the last modified time of ~/.gi_list (where the list of available types is stored)
[-u|--update-list] Update ~/.gi_list

EXAMPLES

@@ -137,7 +137,7 @@

EXAMPLES

AUTHOR

-

Written by Lee-W cl87654321@gmail.com

+

Written by Lee-W cl87654321@gmail.com

REPORTING BUGS

diff --git a/man/git-ignore-io.md b/man/git-ignore-io.md index ca83cfadb..a582f398e 100644 --- a/man/git-ignore-io.md +++ b/man/git-ignore-io.md @@ -15,7 +15,7 @@ Get sample gitignore file from [gitignore.io](https://www.gitignore.io) [-l|--list-in-table] Print available types in table format [-L|--list-alphabetically] Print available types in alphabetical order [-s|--search] Search word in available types -[-t|--show-update-time] Show the last modified time of ~/.gi\_list (where the list of available types stored) +[-t|--show-update-time] Show the last modified time of ~/.gi\_list (where the list of available types is stored) [-u|--update-list] Update ~/.gi\_list ## EXAMPLES From 88c3437a241305c63c481c737252f497595cf66b Mon Sep 17 00:00:00 2001 From: LeeW Date: Sat, 19 Sep 2015 00:42:23 +0800 Subject: [PATCH 21/24] Remove warning when search without word. * Show usage only --- bin/git-ignore-io | 2 -- 1 file changed, 2 deletions(-) diff --git a/bin/git-ignore-io b/bin/git-ignore-io index 1ddc222d4..fc271f74c 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -114,8 +114,6 @@ else opt=$1 shift if [[ $# -eq 0 ]]; then - echo "There should be one word to be searched!!!" - echo show_usage exit fi From 07505518fafe99f1798e4fbf05f58479c3c633b3 Mon Sep 17 00:00:00 2001 From: LeeW Date: Sat, 19 Sep 2015 01:00:31 +0800 Subject: [PATCH 22/24] Remove exclamation mark --- bin/git-ignore-io | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/git-ignore-io b/bin/git-ignore-io index fc271f74c..18c566538 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -86,7 +86,7 @@ else opt=$1 shift if [[ $# -eq 0 ]]; then - echo "There should be at least one type!!!" + echo "There should be at least one type" echo show_usage exit From 37d6012791166d35cd0287bd3234d40cb919b375 Mon Sep 17 00:00:00 2001 From: LeeW Date: Sat, 19 Sep 2015 09:54:53 +0800 Subject: [PATCH 23/24] Replace "export" option with "replace" in git-ignore-io --- bin/git-ignore-io | 10 +++++----- man/git-ignore-io.md | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bin/git-ignore-io b/bin/git-ignore-io index 18c566538..6b616f2dc 100755 --- a/bin/git-ignore-io +++ b/bin/git-ignore-io @@ -46,7 +46,7 @@ gi() { curl -L -s $gitignore_io_url/"$1" } -gi_export() { +gi_replace() { gi "$1" > .gitignore } @@ -58,7 +58,7 @@ show_usage() { echo "Usage:" echo " git ignore-io ... Show gitignore template" echo " [-a|--append] ... Append new .gitignore content to .gitignore under the current directory" - echo " [-e|--export] ... Export new .gitignore to the current directory (The old one will be replaced)" + echo " [-r|--replace] ... Export new .gitignore to the current directory (The old one will be replaced)" echo " [-l|--list-in-table] Print available types in table format" echo " [-L|--list-alphabetically] Print available types in alphabetical order " echo " [-s|--search] Search word in available types" @@ -82,7 +82,7 @@ if [[ $# -eq 0 ]]; then show_usage else case $1 in - -a|--append|-e|--export) + -a|--append|-r|--replace) opt=$1 shift if [[ $# -eq 0 ]]; then @@ -97,8 +97,8 @@ else -a|--append) gi_append "$gi_to_curl" ;; - -e|--export) - gi_export "$gi_to_curl" + -r|--replace) + gi_replace "$gi_to_curl" ;; esac diff --git a/man/git-ignore-io.md b/man/git-ignore-io.md index a582f398e..3bf8c237c 100644 --- a/man/git-ignore-io.md +++ b/man/git-ignore-io.md @@ -11,7 +11,7 @@ Get sample gitignore file from [gitignore.io](https://www.gitignore.io) ## OPTIONS [-a|--append] ... Append new .gitignore content to .gitignore under the current directory -[-e|--export] ... Export new .gitignore to the current directory (The old one will be replaced) +[-r|--replace] ... Export new .gitignore to the current directory (The old one will be replaced) [-l|--list-in-table] Print available types in table format [-L|--list-alphabetically] Print available types in alphabetical order [-s|--search] Search word in available types From 81e8a45b3827a9346525d4284042060ae235a0e7 Mon Sep 17 00:00:00 2001 From: LeeW Date: Sun, 20 Sep 2015 18:44:40 +0800 Subject: [PATCH 24/24] Update git-ignore-io mannual --- man/git-ignore-io.1 | 40 ++++++++++++++++++++++++++++++++-------- man/git-ignore-io.1.html | 33 ++++++++++++++++++++++++--------- man/git-ignore-io.md | 33 +++++++++++++++++++++++++-------- 3 files changed, 81 insertions(+), 25 deletions(-) diff --git a/man/git-ignore-io.1 b/man/git-ignore-io.1 index 9ca855bc8..d5b2f082b 100644 --- a/man/git-ignore-io.1 +++ b/man/git-ignore-io.1 @@ -7,31 +7,55 @@ \fBgit\-ignore\-io\fR \- Get sample gitignore file . .SH "SYNOPSIS" -\fBgit ignore\-io\fR \fIOPTIONS\fR +\fBgit ignore\-io\fR [] . .SH "DESCRIPTION" Get sample gitignore file from gitignore\.io \fIhttps://www\.gitignore\.io\fR . .SH "OPTIONS" -[\-a|\-\-append] \fItypes\fR\.\.\. Append new \.gitignore content to \.gitignore under the current directory + +. +.P +\-a, \-\-append \.\.\. +. +.br +Append new \.gitignore content to \.gitignore under the current directory +. +.P +\-r, \-\-replace \.\.\. . .br -[\-e|\-\-export] \fItypes\fR\.\.\. Export new \.gitignore to the current directory (The old one will be replaced) +Export new \.gitignore to the current directory (The old one will be replaced) +. +.P +\-l, \-\-list\-in\-table . .br -[\-l|\-\-list\-in\-table] Print available types in table format +Print available types in table format +. +.P +\-L, \-\-list\-alphabetically . .br -[\-L|\-\-list\-alphabetically] Print available types in alphabetical order +Print available types in alphabetical order +. +.P +\-s, \-\-search . .br -[\-s|\-\-search] \fIword\fR Search word in available types +Search word in available types +. +.P +\-t, \-\-show\-update\-time . .br -[\-t|\-\-show\-update\-time] Show the last modified time of ~/\.gi_list (where the list of available types is stored) +Show the last modified time of ~/\.gi_list (where the list of available types is stored) +. +.P +\-u, \-\-update\-list . .br -[\-u|\-\-update\-list] Update ~/\.gi_list +Update ~/\.gi_list . .SH "EXAMPLES" Show sample gitignore file for vim diff --git a/man/git-ignore-io.1.html b/man/git-ignore-io.1.html index 47832b508..bcc311d7c 100644 --- a/man/git-ignore-io.1.html +++ b/man/git-ignore-io.1.html @@ -76,7 +76,7 @@

NAME

SYNOPSIS

-

git ignore-io OPTIONS

+

git ignore-io [<OPTIONS>]

DESCRIPTION

@@ -84,13 +84,28 @@

DESCRIPTION

OPTIONS

-

[-a|--append] types... Append new .gitignore content to .gitignore under the current directory
-[-e|--export] types... Export new .gitignore to the current directory (The old one will be replaced)
-[-l|--list-in-table] Print available types in table format
-[-L|--list-alphabetically] Print available types in alphabetical order
-[-s|--search] word Search word in available types
-[-t|--show-update-time] Show the last modified time of ~/.gi_list (where the list of available types is stored)
-[-u|--update-list] Update ~/.gi_list

+

<OPTIONS>

+ +

-a, --append <types>...
+ Append new .gitignore content to .gitignore under the current directory

+ +

-r, --replace <types>...
+ Export new .gitignore to the current directory (The old one will be replaced)

+ +

-l, --list-in-table
+ Print available types in table format

+ +

-L, --list-alphabetically
+ Print available types in alphabetical order

+ +

-s, --search <word>
+ Search word in available types

+ +

-t, --show-update-time
+ Show the last modified time of ~/.gi_list (where the list of available types is stored)

+ +

-u, --update-list
+ Update ~/.gi_list

EXAMPLES

@@ -137,7 +152,7 @@

EXAMPLES

AUTHOR

-

Written by Lee-W cl87654321@gmail.com

+

Written by Lee-W cl87654321@gmail.com

REPORTING BUGS

diff --git a/man/git-ignore-io.md b/man/git-ignore-io.md index 3bf8c237c..8d0edbe21 100644 --- a/man/git-ignore-io.md +++ b/man/git-ignore-io.md @@ -3,20 +3,37 @@ git-ignore-io(1) -- Get sample gitignore file ## SYNOPSIS -`git ignore-io` [OPTIONS] +`git ignore-io` [<OPTIONS>] ## DESCRIPTION + Get sample gitignore file from [gitignore.io](https://www.gitignore.io) ## OPTIONS -[-a|--append] ... Append new .gitignore content to .gitignore under the current directory -[-r|--replace] ... Export new .gitignore to the current directory (The old one will be replaced) -[-l|--list-in-table] Print available types in table format -[-L|--list-alphabetically] Print available types in alphabetical order -[-s|--search] Search word in available types -[-t|--show-update-time] Show the last modified time of ~/.gi\_list (where the list of available types is stored) -[-u|--update-list] Update ~/.gi\_list + <OPTIONS> + + -a, --append <types>... + Append new .gitignore content to .gitignore under the current directory + + -r, --replace <types>... + Export new .gitignore to the current directory (The old one will be replaced) + + -l, --list-in-table + Print available types in table format + + -L, --list-alphabetically + Print available types in alphabetical order + + -s, --search <word> + Search word in available types + + -t, --show-update-time + Show the last modified time of ~/.gi\_list (where the list of available types is stored) + + -u, --update-list + Update ~/.gi\_list + ## EXAMPLES Show sample gitignore file for vim