From a087fe8c11f6139e0e0d48f055f8184e906befce Mon Sep 17 00:00:00 2001 From: gramanas Date: Wed, 26 Sep 2018 12:19:34 +0300 Subject: Add new list option to manual the listing of attributes --- README.html | 242 ++++++++++++++++++++++++++++++------------------------------ README.org | 13 ++-- 2 files changed, 130 insertions(+), 125 deletions(-) diff --git a/README.html b/README.html index dc571b9..622fe6f 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

-
-

1 ck

-
+
+

ck

+

The Config Keeper

-
-

2 build it

-
+
+

build it

+
-
-

2.1 requirements

-
+
+

requirements

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

2.2 compiler

-
+
+

compiler

+

By default I use clang, if you want to use gcc just edit the CMakeLists.txt file and change clang to gcc @@ -303,19 +303,19 @@ edit the CMakeLists.txt file and change clang to

-
-

2.3 make

-
+
+

make

+
-
# clone the repo
+
# clone the repo
 > cd ~/code; git clone https://gitlab.com/grm-grm/ck
-# make a build directory and enter it
-> mkdir ~/ck_build; cd ~/ck_build;
-# run cmake
+# make a build directory and enter it
+> mkdir ~/ck_build; cd ~/ck_build;
+# run cmake
 > cmake ~/code/ck
-# run make
+# run make
 > make
-# run ck
+# run ck
 > ./ck
 
@@ -323,36 +323,36 @@ edit the CMakeLists.txt file and change clang to
-
-

3 for devs

-
+
+

for devs

+
-
-

3.1 make

-
+
+

make

+

Just build with address sanitizer enabled like so: llvm has better asan than gcc, so I use that.

-
# clone the repo
+
# clone the repo
 > cd ~/code; git clone https://gitlab.com/grm-grm/ck
-# make a build directory and enter it
-> mkdir ~/ck_build; cd ~/ck_build;
-# run cmake
+# make a build directory and enter it
+> mkdir ~/ck_build; cd ~/ck_build;
+# run cmake
 > cmake ~/code/ck -DCK_ASAN=ON
-# run make
+# run make
 > make
-# run ck
+# run ck
 > ./ck
 
-
-

3.2 tests

-
+
+

tests

+

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

-
-

3.2.1 run tests

-
+
+

run tests

+

Simply go to the build dir and type.

@@ -374,9 +374,9 @@ Simply go to the build dir and type.
-
-

3.2.2 test suite

-
+
+

test suite

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

4 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 @@ -407,30 +407,30 @@ and intuitive. Example usage:

-
# initialize new ck
-$ ck init /path_to/where_you_want/your_configs/to_be \
+
# initialize new ck
+$ ck init /path_to/where_you_want/your_configs/to_be \
   /path_to/the_secret/directory
 
-# add emacs configs
-## primary config
+# add emacs configs
+## primary config
 $ ck add emacs ~/.emacs.d/orgconf.org -p
-## secret config, with passwords and naughty words
+## secret config, with passwords and naughty words
 $ ck add emacs ~/.emacs.d/accounts.org -s
-## and another one for emacs
+## and another one for emacs
 $ ck add emacs ~/.emacs.d/init.el
 
-# add tmux config
+# add tmux config
 $ ck add tmux ~/.tmux.conf -p
 
-# list the configs
+# list the configs
 $ ck list tree
 $ ck list paths -t lisp
 $ ck list programs -t python
 
-# search the configs
+# search the configs
 $ ck search search-term
-$ ck search "\"search term with spaces\""
-$ ck search "\(" #escape symbols
+$ ck search "\"search term with spaces\""
+$ ck search "\(" #escape symbols
 
@@ -446,9 +446,9 @@ of flags one has to pass to ck.

-
-

4.1 ck configuration

-
+
+

ck configuration

+

ck uses sqlite to index the configuration files. The init action creates a .ck directory (under $HOME) @@ -476,13 +476,13 @@ directory of your choice. Usage:

-
$ ck config ~/ ... # the default behaviour
+
$ ck config ~/ ... # the default behaviour
 
-# /someplace/else must exist or
-# the action following it must be init
+# /someplace/else must exist or
+# the action following it must be init
 $ ck conf /someplace/else ... 
 
-# same thing
+# same thing
 $ ck c /someplace/else ... 
 $ ck -c /someplace/else ... 
 
@@ -490,13 +490,13 @@ $ ck -c /someplace/else ...
-
-

4.2 Actions

-
+
+

Actions

+
-
-

4.2.1 init

-
+
+

init

+

or i or -i

@@ -518,17 +518,17 @@ Use init to initialize a new ck database. Usage:

-
# initialize new ck
-$ ck init /path_to/where_you_want/your_configs/to_be \
+
# initialize new ck
+$ ck init /path_to/where_you_want/your_configs/to_be \
   /path_to/the_secret/directory
 
-
-

4.2.2 add

-
+
+

add

+

or a or -a

@@ -562,22 +562,25 @@ sure to use the same name. Usage:

-
# add config to ck
+
# add config to ck
 $ ck add program_name config_path [-s] [-p]
 
-
-

4.2.3 list

-
+
+

list

+

or ls or l or -l

List can show the paths or the programs that ck keeps track of. +

+ +

With the flag -t and then one of the follwing types one can change the way the list is printed:

@@ -592,28 +595,29 @@ Using the keyword tree ck can list the configurations under their corresponding program.

-
-
/* TODO: show primary and secret atributes */
-
-
+

+Passing the -a flag will enable the listing of config attributes (secret or primary). +It is best used with tree or plain paths. +

+

Usage:

-
# list tree structure
-$ ck list tree
-# list paths in python
+
# list tree structure, with attributes
+$ ck list tree -a
+# list paths in python
 $ ck l paths -t python
-# list programs in lisp
+# list programs in lisp
 $ ck ls programs -t lisp
 
-
-

4.2.4 search

-
+
+

search

+

or s or -s

@@ -635,22 +639,22 @@ To search for special symbols you have to enclose them in quotes and escape them Usage:

-
# search for parenthesis
-$ ck search "\("
-# search term with spaces
-$ ck search "\"This is a space\""
-# both
-$ ck search "\"(add 2 4)\""
-# and a normal one
+
# search for parenthesis
+$ ck search "\("
+# search term with spaces
+$ ck search "\"This is a space\""
+# both
+$ ck search "\"(add 2 4)\""
+# and a normal one
 $ ck search alias
 
-
-

4.2.5 edit

-
+
+

edit

+

or e or -e

@@ -676,7 +680,7 @@ To do it use:
-

Created: 2018-09-23 Sun 00:15

+

Created: 2018-09-26 Wed 12:17

Validate

diff --git a/README.org b/README.org index 7c71738..757b991 100644 --- a/README.org +++ b/README.org @@ -1,4 +1,4 @@ -#+OPTIONS: ^:nil +#+OPTIONS: ^:nil num:nil #+html:

* ck *The Config Keeper* @@ -184,6 +184,7 @@ Usage: or ls or l or -l List can show the *paths* or the *programs* that ck keeps track of. + With the flag *-t* and then one of the follwing types one can change the way the list is printed: - *plain*: simple listing (default) @@ -193,13 +194,13 @@ the way the list is printed: Using the keyword *tree* ck can list the configurations under their corresponding program. -#+BEGIN_SRC C - /* TODO: show primary and secret atributes */ -#+END_SRC +Passing the *-a* flag will enable the listing of config attributes (secret or primary). +It is best used with tree or plain paths. + Usage: #+BEGIN_SRC sh - # list tree structure - $ ck list tree + # list tree structure, with attributes + $ ck list tree -a # list paths in python $ ck l paths -t python # list programs in lisp -- cgit v1.2.3