From 598e0522de924a50ea9c640955daab8512029eb4 Mon Sep 17 00:00:00 2001 From: gramanas Date: Tue, 9 Oct 2018 20:53:30 +0300 Subject: Better list --- README.html | 284 ++++++++++++++++++++++++++++++++---------------------------- 1 file changed, 152 insertions(+), 132 deletions(-) (limited to 'README.html') diff --git a/README.html b/README.html index 2180663..45839fd 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,31 +293,31 @@ for the JavaScript code in this tag.
-
-

compiler

-
+
+

compiler

+
-
> export CC=clang
-# or
-> export CC=gcc
+
> export CC=clang
+# or
+> export CC=gcc
 
-
-

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
 
@@ -325,21 +325,21 @@ for the JavaScript code in this tag.
-
-

for devs

-
+
+

for devs

+
-
-

CMake options

-
+
+

CMake options

+

cmake accepts the following options:

-
option(CK_ASAN "Build with asan")
-option(CK_DEBUG "Build with debug symbols")
-option(CK_TESTS "Make the tests")
-option(CK_SHARED "Build with shared lib")
+
option(CK_ASAN "Build with asan")
+option(CK_DEBUG "Build with debug symbols")
+option(CK_TESTS "Make the tests")
+option(CK_SHARED "Build with shared lib")
 
@@ -356,24 +356,24 @@ 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 -DCK_ASAN=1 -DCK_DEBUG=1 -DCK_TESTS=1 ~/code/ck
-# run make
+# run make
 > make
-# run ck
+# run ck
 > ./ck
 
-
-

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 @@ -429,30 +429,31 @@ 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
+$ ck list -p emacs
 
-# 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
 
@@ -468,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) @@ -498,13 +499,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 ... 
 
@@ -512,13 +513,13 @@ $ ck -c /someplace/else ...
-
-

Actions

-
+
+

Actions

+
-
-

init

-
+
+

init

+

or i or -i

@@ -540,17 +541,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
 
-
-

add

-
+
+

add

+

or a or -a

@@ -584,24 +585,33 @@ sure to use the same name. Usage:

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

list

-
+
+

list

+

or ls or l or -l

-List can show the paths or the programs that ck keeps track of. +List stuff ck knows about.

+

+You can use the keywords: +

+
    +
  • paths: to print all the paths ck tracks
  • +
  • programs: to print all the programs ck tracks
  • +
  • -p progName: (without the "<>") to print the paths of a specific program
  • +
+

With the flag -t and then one of the follwing types one can change the way the list is printed: @@ -614,7 +624,7 @@ the way the list is printed:

Using the keyword tree ck can list the configurations under their -corresponding program. +corresponding program, in a treelike structure.

@@ -622,24 +632,34 @@ Passing the -a flag will enable the listing of config attributes (secret It is best used with tree or plain paths.

+

+With the keyword ckconf ck will list it's own configuration values (in ckrc). +

+

Usage:

-
# list tree structure, with attributes
+
# list tree structure, with attributes
 $ ck list tree -a
-# list paths in python
+# list paths in python
 $ ck l paths -t python
-# list programs in lisp
+# list programs in lisp
 $ ck ls programs -t lisp
+# list emacs' configurations [with attributes]
+$ ck ls -p emacs [-a]
+# list bash configurations in lisp
+$ ck ls -p bash -t lisp
+# list ck configuration
+$ ck -l ckconf
 
-
-

search

-
+
+

search

+

or s or -s

@@ -660,13 +680,13 @@ To search for terms with spaces you have to put them in quotes. 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
 
@@ -677,20 +697,20 @@ a different pattern matching program you can do it like so:

-
# with xargs
-$ ck ls paths | xargs grep -E 'A|B'
-# or in bash
-$ for i in $(ck ls paths); do grep -E 'A|B' $i; done
-# or in zsh
-$ for i ($(ck ls paths)) grep -E 'A|B' $i
+
# with xargs
+$ ck ls paths | xargs grep -E 'A|B'
+# or in bash
+$ for i in $(ck ls paths); do grep -E 'A|B' $i; done
+# or in zsh
+$ for i ($(ck ls paths)) grep -E 'A|B' $i
 
-
-

edit

-
+
+

edit

+

or e or -e

@@ -719,17 +739,17 @@ print the avaliable configurations and exit. Usage:

-
# suppose this is our ck instance
+
# suppose this is our ck instance
 $ ck list tree -a
 emacs:
 |- init.el
 |- accounts.el [s]
 |- orgconf.org [p]
 
-# edit the primary emacs config
+# edit the primary emacs config
 $ ck edit emacs
 
-# edit a specific emacs config, other than the primary
+# edit a specific emacs config, other than the primary
 $ ck edit emacs accounts.el
 
@@ -739,7 +759,7 @@ $ ck edit emacs accounts.el
-

Created: 2018-10-08 Mon 23:46

+

Created: 2018-10-09 Tue 20:53

Validate

-- cgit v1.2.3