From a6290ec9d98e3b7cc650db134b17ee6d6a64f46d Mon Sep 17 00:00:00 2001 From: gramanas Date: Mon, 19 Nov 2018 01:39:55 +0200 Subject: Update readme --- README.html | 295 +++++++++++++++++++++++++++++++++++------------------------- README.org | 12 ++- 2 files changed, 183 insertions(+), 124 deletions(-) diff --git a/README.html b/README.html index 4c8647c..286583d 100644 --- a/README.html +++ b/README.html @@ -3,7 +3,7 @@ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> - + @@ -232,36 +232,36 @@ for the JavaScript code in this tag.

Table of Contents

-
-

ck

-
+
+

ck

+

The Config Keeper

@@ -327,9 +327,9 @@ with the rest of us).

-
-

Technicalities

-
+
+

Technicalities

+

Upon adding a config to ck, it moves it to the specified folder and adds a symbolic link back where it came from (ln -s). @@ -342,9 +342,9 @@ majority should).

-
-

Download

-
+
+

Download

+

Go ahead and download ck and give it a try. It comes with a help sub-command that explains any inquires you might have. @@ -362,13 +362,13 @@ You can also read the manpage down below.

-
-

build it

+
+

build it

-
-

requirements

-
+
+

requirements

+
  • cmake
  • sqlite3-dev
  • @@ -377,9 +377,9 @@ You can also read the manpage down below.
-
-

make && install

-
+
+

make && install

+

Use -DCMAKE_INSTALL_PREFIX when running cmake to change the install path.

@@ -402,16 +402,16 @@ Use -DCMAKE_INSTALL_PREFIX when running cmake to change the install
-
-

for devs

-
+
+

for devs

+

Please be kind to each other.

-
-

CMake options

-
+
+

CMake options

+

cmake accepts the following options:

@@ -432,9 +432,9 @@ To use any one of them append it after the cmake command like so:
-
-

compiler

-
+
+

compiler

+

Pick your favorite

@@ -464,9 +464,9 @@ Pick your favorite
-
-

tests

-
+
+

tests

+

The testing "suite" is a bash script that runs regression and unit tests. Regression tests are under the tests/ directory @@ -475,9 +475,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: @@ -489,9 +489,9 @@ go to the build directory and type:

-
-

test suite

-
+
+

test suite

+
$ ./test-ck -h
 ck test suite
@@ -509,17 +509,17 @@ flags:
 
-
-

ck configuration

-
+
+

ck configuration

+

See the manpage below.

-
-

Usage

+
+

Usage

ck's goal is to assist with the configuration file management. @@ -529,9 +529,9 @@ ck's goal is to assist with the configuration file management. This section is an example usage.

-
-

Initialize

-
+
+

Initialize

+
cd ~
 # make the directories for the configs
@@ -544,9 +544,9 @@ $ ck init configs/vc configs/sec
 
-
-

Add configs

-
+
+

Add configs

+
# add emacs configs
 ## primary config
@@ -574,9 +574,9 @@ $ sudo ck -c /home/ckuser add ssh /etc/ssh/sshd_config -s
 
-
-

Using the ck actions

-
+
+

Using the ck actions

+
# list the configs in a treelike structure with basename only
 $ ck list tree -b
@@ -596,17 +596,23 @@ $ ck search "search term with spaces"
 # escape symbols
 $ ck search \(
 
-# edit the primary config of emacs
+# edit the primary config of emacs wiht $EDITOR
 $ ck edit emacs
+# or with vi
+$ ck e emacs --editor vi
+# run the command cat to it
+$ ck edit emacs --command cat
+# or a complex editor call
+$ ck edit emacs --command "emacsclient -a \"\" -t"
 # edit a non-primary config of ssh
-$ ck e ssh authorized_keys
+$ ck e emacs init.el
 # edit a root config
-$ sudo ck -c /home/ckuser e ssh sshd_config
+$ ck e ssh -s
 
 # delete a program with all the configs
 $ ck delete emacs
 # or a specific config
-$ ck del -c /home/ckuser/.emacs.d/init.el
+$ ck del emacs init.el
 
 # restore all links (on a new instalation)
 $ ck restore all
@@ -622,11 +628,11 @@ $ ck --help e
 
-
-

manpage

+
+

manpage

- + @@ -684,14 +690,14 @@ manage configuration across the system

ck

- +

[−v|−−verbose] [−c|−−config DIR] action [...]

- + @@ -700,11 +706,11 @@ manage configuration across the system

ck

- +

[version|−−version]

- + @@ -713,11 +719,11 @@ manage configuration across the system

ck

- +

init VERSION_CONTROL_DIR SECRET_DIR

- + @@ -726,12 +732,12 @@ manage configuration across the system

ck

- +

add PROGRAM_NAME CONFIG_PATH [−p] [−s]

- + @@ -740,12 +746,12 @@ manage configuration across the system

ck

- +

delete PROGRAM_NAME [CONFIG_BASENAME]

- + @@ -754,11 +760,11 @@ manage configuration across the system

ck

- +

list tree [−a] [−b]

- + @@ -767,13 +773,13 @@ manage configuration across the system

ck

- +

list −p PROGRAM_NAME [−t list-type] [−a] [−b]

- + @@ -782,13 +788,13 @@ manage configuration across the system

ck

- +

list programs [−t list-type] [−a] [−b]

- + @@ -797,13 +803,13 @@ manage configuration across the system

ck

- +

list paths [−t list-type] [−a] [−b]

- + @@ -812,11 +818,11 @@ manage configuration across the system

ck

- +

list ckconf

- + @@ -825,12 +831,14 @@ manage configuration across the system

ck

- + -

edit PROGRAM_NAME -[CONFIG_BASENAME]

- +

edit PROGRAM_NAME [CONFIG_BASENAME] +[−−editor EDITOR] +[−−command COMMAND] +[−s]

+ @@ -839,11 +847,11 @@ manage configuration across the system

ck

- +

search SEARCH_TERM

- + @@ -852,11 +860,11 @@ manage configuration across the system

ck

- +

restore −p PROGRAM_NAME

- + @@ -865,11 +873,11 @@ manage configuration across the system

ck

- +

restore all

- + @@ -878,11 +886,11 @@ manage configuration across the system

ck

- +

help action

- + @@ -916,10 +924,10 @@ directory, and then symbolically linked back to it’s original place (ln -s).

In a later time -you can sync the VERSION_CONRTOL_DIR and +you can sync the VERSION_CONTROL_DIR and SECRET_DIR. You can also restore the links -given these two directories and the correspondig rc file and -database.

+given these two directories and the corresponding rc file +and database.

CONFIGURATION @@ -936,8 +944,8 @@ action by default creates a directory in witch the first search for the configuration in the folder shown by the $CK_CONFIG environment variable. If it is set it will use the ckrc and ckdb inside this -directory. Else it wil use $XDG_CONFIG_HOME/ck and if -that is not set as well it will fall back to +directory. Else it will use $XDG_CONFIG_HOME/ck and +if that is not set as well it will fall back to $HOME/.ck.

One can have @@ -955,8 +963,8 @@ details.

Change -ck behaviour using the following options. They must -be present before any action.
+ck behavior using the following options. They must be +present before any action.
−−verbose
, −v

[WIP]
@@ -973,7 +981,7 @@ order to work.

−−version, version

-

Print version and licence +

Print version and license information, and quit.

ACTIONS @@ -1402,7 +1410,7 @@ a lisp list.

-

Show attributes to the listing (when aplicable). These +

Show attributes to the listing (when applicable). These are [s] for secret, [p] for primary and [root] if the file is owned by the root user.

@@ -1448,13 +1456,13 @@ USAGE

ck

- + -

edit PROGRAM_NAME -[CONFIG_BASENAME]

- - +

edit PROGRAM_NAME [CONFIG_BASENAME] +[−−editor EDITOR] +[−−command COMMAND] +[−s]

ALIASES

@@ -1496,10 +1504,55 @@ when editing a config other than the primary one.

+

FLAGS

+ + + + + + + + + + + + + + + + + +
+ + +

−−editor EDITOR

+ + +

Use EDITOR to edit the config.

+ + +

−−command COMMAND

+ + +

The COMMAND string will be used instead of an +editor.

+ + +

−−s

+ + +

Prepend the whole command with sudo, should you want to +edit a config belonging to root.

+

EXAMPLES

$ ck edit emacs
-$ ck e tmux .tmux.conf
+$ ck edit emacs --command cat +$ ck edit emacs --command "emacsclient -a +$ ck e tmux .tmux.conf +$ ck e tmux .tmux.conf --editor vi +$ ck e ssh -s

SEARCH @@ -1595,7 +1648,7 @@ the user as the owner instead of the root.

ck checks that the configs exist and that the location -for the link is avaliable before making any links. However, +for the link is available before making any links. However, in the even that symlink fails for some other reason, the process will stop as is. The user will have to take care of the already created links, if that’s the case. @@ -1801,7 +1854,7 @@ flags: @CMAKE_C_FLAGS@

-

Created: 2018-11-14 Wed 16:42

+

Created: 2018-11-19 Mon 01:39

Validate

diff --git a/README.org b/README.org index 6090850..756ed3a 100644 --- a/README.org +++ b/README.org @@ -205,12 +205,18 @@ This section is an example usage. # escape symbols $ ck search \( - # edit the primary config of emacs + # edit the primary config of emacs wiht $EDITOR $ ck edit emacs + # or with vi + $ ck e emacs --editor vi + # run the command cat to it + $ ck edit emacs --command cat + # or a complex editor call + $ ck edit emacs --command "emacsclient -a \"\" -t" # edit a non-primary config of ssh - $ ck e ssh authorized_keys + $ ck e emacs init.el # edit a root config - $ sudo ck -c /home/ckuser e ssh sshd_config + $ ck e ssh -s # delete a program with all the configs $ ck delete emacs -- cgit v1.2.3