From 855c582f5eecaab2cb5637a5157658f7cb71cc1d Mon Sep 17 00:00:00 2001 From: gramanas Date: Tue, 9 Oct 2018 20:56:48 +0300 Subject: Add grep to search aliases --- README.html | 156 ++++++++++++++++++++++++++--------------------------- README.org | 8 +-- src/actionparser.c | 2 +- 3 files changed, 83 insertions(+), 83 deletions(-) diff --git a/README.html b/README.html index 45839fd..4ebb066 100644 --- a/README.html +++ b/README.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + @@ -232,35 +232,35 @@ for the JavaScript code in this tag.

Table of Contents

-
-

ck

-
+
+

ck

+

The Config Keeper

-
-

build it

-
+
+

build it

+
-
-

requirements

-
+
+

requirements

+
  • clang (llvm) or gcc (gnu)
  • cmake
  • @@ -293,9 +293,9 @@ for the JavaScript code in this tag.
-
-

compiler

-
+
+

compiler

+
> export CC=clang
 # or
@@ -305,9 +305,9 @@ for the JavaScript code in this tag.
 
-
-

make

-
+
+

make

+
# clone the repo
 > cd ~/code; git clone https://gitlab.com/grm-grm/ck
@@ -325,13 +325,13 @@ for the JavaScript code in this tag.
 
-
-

for devs

-
+
+

for devs

+
-
-

CMake options

-
+
+

CMake options

+

cmake accepts the following options:

@@ -371,9 +371,9 @@ llvm has better asan than gcc, so I use that.
-
-

tests

-
+
+

tests

+

The testing "suite" is a bash script that runs regression and unit tests. Regression tests are under the tests/ directory @@ -382,9 +382,9 @@ under unit/ directory and test the code.

-
-

run tests

-
+
+

run tests

+

First make sure you build ck with the -DCK_TESTS=1 option. Then go to the build directory and type: @@ -396,9 +396,9 @@ go to the build directory and type:

-
-

test suite

-
+
+

test suite

+
$ ./test-ck -h
 ck test suite
@@ -416,9 +416,9 @@ flags:
 
-
-

manual

-
+
+

manual

+

ck's goal is to assist with the configuration file management. To that end it tries to provides a cli interface that is pretty straight-forward @@ -469,9 +469,9 @@ of flags one has to pass to ck.

-
-

ck configuration

-
+
+

ck configuration

+

ck uses sqlite to index the configuration files. The init action creates a .ck directory (under $HOME) @@ -513,13 +513,13 @@ $ ck -c /someplace/else ...

-
-

Actions

-
+
+

Actions

+
-
-

init

-
+
+

init

+

or i or -i

@@ -549,9 +549,9 @@ $ ck init /path_to/where_you_want/your_configs/to_be -

add

-
+
+

add

+

or a or -a

@@ -592,9 +592,9 @@ $ ck add program_name config_path [-s] [-p]
-
-

list

-
+
+

list

+

or ls or l or -l

@@ -657,11 +657,11 @@ $ ck -l ckconf
-
-

search

-
+
+

search

+

-or s or -s +or grep or s or -s

@@ -683,11 +683,11 @@ Usage:

# search for parenthesis
 $ ck search \(
 # search term with spaces
-$ ck search "This is a space"
+$ ck grep "This is a space"
 # both
-$ ck search "(add 2 4)"
+$ ck s "(add 2 4)"
 # and a normal one
-$ ck search alias
+$ ck -s alias
 
@@ -708,9 +708,9 @@ $ for i ($(ck ls paths)) grep -E 'A|B' $
-
-

edit

-
+
+

edit

+

or e or -e

@@ -759,7 +759,7 @@ $ ck edit emacs accounts.el
-

Created: 2018-10-09 Tue 20:53

+

Created: 2018-10-09 Tue 20:56

Validate

diff --git a/README.org b/README.org index c03a093..4f4fc52 100644 --- a/README.org +++ b/README.org @@ -239,7 +239,7 @@ Usage: #+END_SRC *** search -or s or -s +or grep or s or -s Perform infile grep in all the configurations ck keeps track of. @@ -252,11 +252,11 @@ Usage: # search for parenthesis $ ck search \( # search term with spaces - $ ck search "This is a space" + $ ck grep "This is a space" # both - $ ck search "(add 2 4)" + $ ck s "(add 2 4)" # and a normal one - $ ck search alias + $ ck -s alias #+END_SRC If you want to use more advanced grep techniques or even diff --git a/src/actionparser.c b/src/actionparser.c index 1da1d2f..be96bb3 100644 --- a/src/actionparser.c +++ b/src/actionparser.c @@ -27,7 +27,7 @@ const char* const strADD[] = {"3", "add", "a", "-a"}; const char* const strDEL[] = {"4", "delete", "del","d", "-d"}; const char* const strEDIT[] = {"3", "edit", "e", "-e"}; const char* const strLIST[] = {"5", "list", "ls", "l", "-l", "-ls"}; -const char* const strSEARCH[] = {"3", "search", "s", "-s"}; +const char* const strSEARCH[] = {"4", "search", "grep", "s", "-s"}; const char* const strHELP[] = {"5", "help", "h", "-?", "-h", "--help"}; const char* const strConfDir[] = {"4", "config", "conf", "c", "-c"}; const char* const strVersion[] = {"2", "version", "--version"}; -- cgit v1.2.3