aboutsummaryrefslogtreecommitdiffstats
path: root/README.html
diff options
context:
space:
mode:
authorgramanas <anastasis.gramm2@gmail.com>2018-10-29 17:20:28 +0200
committergramanas <anastasis.gramm2@gmail.com>2018-10-29 17:20:28 +0200
commit5683c51d17b5eed7d2f070aa4e49cc21b65d82e5 (patch)
treef6eea31de970bf3b5233545b7296a0d81e60836e /README.html
parent56fdf6de6ee00f1eb4303065c26811310a7c0728 (diff)
downloadck-5683c51d17b5eed7d2f070aa4e49cc21b65d82e5.tar.gz
ck-5683c51d17b5eed7d2f070aa4e49cc21b65d82e5.tar.bz2
ck-5683c51d17b5eed7d2f070aa4e49cc21b65d82e5.zip
Add list with basename and update readme
Diffstat (limited to 'README.html')
-rw-r--r--README.html657
1 files changed, 214 insertions, 443 deletions
diff --git a/README.html b/README.html
index f6bd550..655204c 100644
--- a/README.html
+++ b/README.html
@@ -3,7 +3,7 @@
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
-<!-- 2018-10-28 Sun 13:22 -->
+<!-- 2018-10-29 Mon 17:20 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>&lrm;</title>
@@ -232,53 +232,46 @@ for the JavaScript code in this tag.
<h2>Table of Contents</h2>
<div id="text-table-of-contents">
<ul>
-<li><a href="#orgf8d00be">ck</a>
+<li><a href="#org00fe9a3">ck</a>
<ul>
-<li><a href="#orgf43f116">Technicalities</a></li>
-<li><a href="#orge578423">Download</a></li>
+<li><a href="#orgddefd39">Technicalities</a></li>
+<li><a href="#org52a8ede">Download</a></li>
</ul>
</li>
<li><a href="#build-instructions">build it</a>
<ul>
-<li><a href="#org6787614">requirements</a></li>
-<li><a href="#org5689497">make &amp;&amp; install</a></li>
+<li><a href="#orge924f4c">requirements</a></li>
+<li><a href="#orga1d810a">make &amp;&amp; install</a></li>
</ul>
</li>
-<li><a href="#org8db7ac9">for devs</a>
+<li><a href="#org421fdfb">for devs</a>
<ul>
-<li><a href="#org42a6614">CMake options</a></li>
-<li><a href="#org5501d31">compiler</a></li>
-<li><a href="#org3720cae">tests</a>
+<li><a href="#org98bcc06">CMake options</a></li>
+<li><a href="#org945fa72">compiler</a></li>
+<li><a href="#orge94d2b6">tests</a>
<ul>
-<li><a href="#org7b06e14">run tests</a></li>
-<li><a href="#org7ad16bc">test suite</a></li>
+<li><a href="#org6d98a70">run tests</a></li>
+<li><a href="#orgdf6a992">test suite</a></li>
</ul>
</li>
</ul>
</li>
-<li><a href="#manual">manual</a>
+<li><a href="#org5444b91">ck configuration</a></li>
+<li><a href="#usage">Usage</a>
<ul>
-<li><a href="#orgb40149d">ck configuration</a></li>
-<li><a href="#org52aba1d">Actions</a>
-<ul>
-<li><a href="#org7ba72be">init</a></li>
-<li><a href="#org9ae26ce">add</a></li>
-<li><a href="#orgb4adc9b">list</a></li>
-<li><a href="#org442a05c">search</a></li>
-<li><a href="#org6320932">edit</a></li>
-<li><a href="#orgae8e7fb">restore</a></li>
-</ul>
-</li>
+<li><a href="#orgd2e5354">Initialize</a></li>
+<li><a href="#orgfc9d01c">Add configs</a></li>
+<li><a href="#orga6dee7d">Using the ck actions</a></li>
</ul>
</li>
-<li><a href="#orgf44bdc3">manpage</a></li>
+<li><a href="#manpage">manpage</a></li>
</ul>
</div>
</div>
<p align="center"><img src="res/logo.png"></p>
-<div id="outline-container-orgf8d00be" class="outline-2">
-<h2 id="orgf8d00be">ck</h2>
-<div class="outline-text-2" id="text-orgf8d00be">
+<div id="outline-container-org00fe9a3" class="outline-2">
+<h2 id="org00fe9a3">ck</h2>
+<div class="outline-text-2" id="text-org00fe9a3">
<p>
<b>The Config Keeper</b>
</p>
@@ -334,9 +327,9 @@ with the rest of us).
</p>
</div>
-<div id="outline-container-orgf43f116" class="outline-3">
-<h3 id="orgf43f116">Technicalities</h3>
-<div class="outline-text-3" id="text-orgf43f116">
+<div id="outline-container-orgddefd39" class="outline-3">
+<h3 id="orgddefd39">Technicalities</h3>
+<div class="outline-text-3" id="text-orgddefd39">
<p>
Upon adding a config to <b>ck</b>, it moves it to the specified folder and adds a symbolic link
back where it came from (<code>ln -s</code>).
@@ -349,9 +342,9 @@ majority should).
</div>
</div>
-<div id="outline-container-orge578423" class="outline-3">
-<h3 id="orge578423">Download</h3>
-<div class="outline-text-3" id="text-orge578423">
+<div id="outline-container-org52a8ede" class="outline-3">
+<h3 id="org52a8ede">Download</h3>
+<div class="outline-text-3" id="text-org52a8ede">
<p>
Go ahead and download <b>ck</b> and give it a try. It comes with a help sub-command
that explains any inquires you might have.
@@ -363,19 +356,19 @@ the <a href="#build-instructions">build</a> section.
</p>
<p>
-You can also read the manual <a href="#manual">down below</a>.
+You can also read the manpage <a href="#manpage">down below</a>.
</p>
</div>
</div>
</div>
-<div id="outline-container-orgeb48bed" class="outline-2">
-<h2 id="build-instructions"><a id="orgeb48bed"></a>build it</h2>
+<div id="outline-container-orgde5aa18" class="outline-2">
+<h2 id="build-instructions"><a id="orgde5aa18"></a>build it</h2>
<div class="outline-text-2" id="text-build-instructions">
</div>
-<div id="outline-container-org6787614" class="outline-3">
-<h3 id="org6787614">requirements</h3>
-<div class="outline-text-3" id="text-org6787614">
+<div id="outline-container-orge924f4c" class="outline-3">
+<h3 id="orge924f4c">requirements</h3>
+<div class="outline-text-3" id="text-orge924f4c">
<ul class="org-ul">
<li>cmake</li>
<li>sqlite3-dev</li>
@@ -384,24 +377,24 @@ You can also read the manual <a href="#manual">down below</a>.
</div>
</div>
-<div id="outline-container-org5689497" class="outline-3">
-<h3 id="org5689497">make &amp;&amp; install</h3>
-<div class="outline-text-3" id="text-org5689497">
+<div id="outline-container-orga1d810a" class="outline-3">
+<h3 id="orga1d810a">make &amp;&amp; install</h3>
+<div class="outline-text-3" id="text-orga1d810a">
<p>
Use <code>-DCMAKE_INSTALL_PREFIX</code> when running cmake to change the install path.
</p>
<div class="org-src-container">
-<pre class="src src-sh"><span style="color: #656565;"># </span><span style="color: #757575;">clone the repo</span>
+<pre class="src src-sh"><span class="org-comment-delimiter"># </span><span class="org-comment">clone the repo</span>
&gt; cd ~/code; git clone https://gitlab.com/grm-grm/ck
-<span style="color: #656565;"># </span><span style="color: #757575;">make a build directory and enter it</span>
-&gt; mkdir ~/ck_build; <span style="color: #528fd1;">cd</span> ~/ck_build;
-<span style="color: #656565;"># </span><span style="color: #757575;">run cmake</span>
+<span class="org-comment-delimiter"># </span><span class="org-comment">make a build directory and enter it</span>
+&gt; mkdir ~/ck_build; <span class="org-builtin">cd</span> ~/ck_build;
+<span class="org-comment-delimiter"># </span><span class="org-comment">run cmake</span>
&gt; cmake ~/code/ck
-<span style="color: #656565;"># </span><span style="color: #757575;">run make</span>
+<span class="org-comment-delimiter"># </span><span class="org-comment">run make</span>
&gt; make
-<span style="color: #656565;"># </span><span style="color: #757575;">install it</span>
+<span class="org-comment-delimiter"># </span><span class="org-comment">install it</span>
&gt; make install
-<span style="color: #656565;"># </span><span style="color: #757575;">run ck</span>
+<span class="org-comment-delimiter"># </span><span class="org-comment">run ck</span>
&gt; ck
</pre>
</div>
@@ -409,23 +402,23 @@ Use <code>-DCMAKE_INSTALL_PREFIX</code> when running cmake to change the install
</div>
</div>
-<div id="outline-container-org8db7ac9" class="outline-2">
-<h2 id="org8db7ac9">for devs</h2>
-<div class="outline-text-2" id="text-org8db7ac9">
+<div id="outline-container-org421fdfb" class="outline-2">
+<h2 id="org421fdfb">for devs</h2>
+<div class="outline-text-2" id="text-org421fdfb">
<p>
Please be <a href="https://www.gnu.org/philosophy/kind-communication.html">kind</a> to each other.
</p>
</div>
-<div id="outline-container-org42a6614" class="outline-3">
-<h3 id="org42a6614">CMake options</h3>
-<div class="outline-text-3" id="text-org42a6614">
+<div id="outline-container-org98bcc06" class="outline-3">
+<h3 id="org98bcc06">CMake options</h3>
+<div class="outline-text-3" id="text-org98bcc06">
<p>
cmake accepts the following options:
</p>
<div class="org-src-container">
-<pre class="src src-cmake"><span style="color: #6aaf50;">option</span>(CK_DEBUG <span style="color: #bdbc61;">"Build with debug symbols, asan and warnings"</span>)
-<span style="color: #6aaf50;">option</span>(CK_TESTS <span style="color: #bdbc61;">"Make the tests"</span>)
-<span style="color: #6aaf50;">option</span>(CK_SHARED <span style="color: #bdbc61;">"Build with shared lib"</span>)
+<pre class="src src-cmake"><span class="org-function-name">option</span>(CK_DEBUG <span class="org-string">"Build with debug symbols, asan and warnings"</span>)
+<span class="org-function-name">option</span>(CK_TESTS <span class="org-string">"Make the tests"</span>)
+<span class="org-function-name">option</span>(CK_SHARED <span class="org-string">"Build with shared lib"</span>)
</pre>
</div>
@@ -439,41 +432,41 @@ To use any one of them append it after the cmake command like so:
</div>
</div>
-<div id="outline-container-org5501d31" class="outline-3">
-<h3 id="org5501d31">compiler</h3>
-<div class="outline-text-3" id="text-org5501d31">
+<div id="outline-container-org945fa72" class="outline-3">
+<h3 id="org945fa72">compiler</h3>
+<div class="outline-text-3" id="text-org945fa72">
<p>
Pick your favorite
</p>
<div class="org-src-container">
-<pre class="src src-sh">&gt; export <span style="color: #baba36;">CC</span>=clang
-<span style="color: #656565;"># </span><span style="color: #757575;">or</span>
-&gt; export <span style="color: #baba36;">CC</span>=gcc
+<pre class="src src-sh">&gt; export <span class="org-variable-name">CC</span>=clang
+<span class="org-comment-delimiter"># </span><span class="org-comment">or</span>
+&gt; export <span class="org-variable-name">CC</span>=gcc
</pre>
</div>
<div class="org-src-container">
-<pre class="src src-sh"><span style="color: #656565;"># </span><span style="color: #757575;">clone the repo</span>
+<pre class="src src-sh"><span class="org-comment-delimiter"># </span><span class="org-comment">clone the repo</span>
&gt; cd ~/code; git clone https://gitlab.com/grm-grm/ck
-<span style="color: #656565;"># </span><span style="color: #757575;">make a build directory and enter it</span>
-&gt; mkdir ~/ck_build; <span style="color: #528fd1;">cd</span> ~/ck_build;
-<span style="color: #656565;"># </span><span style="color: #757575;">run cmake</span>
+<span class="org-comment-delimiter"># </span><span class="org-comment">make a build directory and enter it</span>
+&gt; mkdir ~/ck_build; <span class="org-builtin">cd</span> ~/ck_build;
+<span class="org-comment-delimiter"># </span><span class="org-comment">run cmake</span>
&gt; cmake -DCK_DEBUG=1 -DCK_TESTS=1 ~/code/ck
-<span style="color: #656565;"># </span><span style="color: #757575;">run make</span>
+<span class="org-comment-delimiter"># </span><span class="org-comment">run make</span>
&gt; make
-<span style="color: #656565;"># </span><span style="color: #757575;">check ck</span>
+<span class="org-comment-delimiter"># </span><span class="org-comment">check ck</span>
&gt; ./test-ck
-<span style="color: #656565;"># </span><span style="color: #757575;">run ck</span>
+<span class="org-comment-delimiter"># </span><span class="org-comment">run ck</span>
&gt; ./ck
</pre>
</div>
</div>
</div>
-<div id="outline-container-org3720cae" class="outline-3">
-<h3 id="org3720cae">tests</h3>
-<div class="outline-text-3" id="text-org3720cae">
+<div id="outline-container-orge94d2b6" class="outline-3">
+<h3 id="orge94d2b6">tests</h3>
+<div class="outline-text-3" id="text-orge94d2b6">
<p>
The testing "suite" is a bash script that runs regression
and unit tests. Regression tests are under the <code>tests/</code> directory
@@ -482,9 +475,9 @@ under <code>unit/</code> directory and test the code.
</p>
</div>
-<div id="outline-container-org7b06e14" class="outline-4">
-<h4 id="org7b06e14">run tests</h4>
-<div class="outline-text-4" id="text-org7b06e14">
+<div id="outline-container-org6d98a70" class="outline-4">
+<h4 id="org6d98a70">run tests</h4>
+<div class="outline-text-4" id="text-org6d98a70">
<p>
First make sure you build ck with the <code>-DCK_TESTS=1</code> option. Then
go to the build directory and type:
@@ -496,9 +489,9 @@ go to the build directory and type:
</div>
</div>
-<div id="outline-container-org7ad16bc" class="outline-4">
-<h4 id="org7ad16bc">test suite</h4>
-<div class="outline-text-4" id="text-org7ad16bc">
+<div id="outline-container-orgdf6a992" class="outline-4">
+<h4 id="orgdf6a992">test suite</h4>
+<div class="outline-text-4" id="text-orgdf6a992">
<div class="org-src-container">
<pre class="src src-sh">$ ./test-ck -h
ck test suite
@@ -516,400 +509,124 @@ flags:
</div>
</div>
</div>
-<div id="outline-container-orgfd8f2dc" class="outline-2">
-<h2 id="manual"><a id="orgfd8f2dc"></a>manual</h2>
-<div class="outline-text-2" id="text-manual">
-<p>
-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
-and intuitive.
-</p>
-
+<div id="outline-container-org5444b91" class="outline-2">
+<h2 id="org5444b91">ck configuration</h2>
+<div class="outline-text-2" id="text-org5444b91">
<p>
-Example usage:
+See the <a href="#manpage">manpage</a> below.
</p>
-<div class="org-src-container">
-<pre class="src src-sh"><span style="color: #656565;"># </span><span style="color: #757575;">initialize new ck</span>
-$ ck init /path_to/where_you_want/your_configs/to_be <span style="color: #bdbc61;">\</span>
- /path_to/the_secret/directory
-
-<span style="color: #656565;"># </span><span style="color: #757575;">add emacs configs</span>
-<span style="color: #656565;">## </span><span style="color: #757575;">primary config</span>
-$ ck add emacs ~/.emacs.d/orgconf.org -p
-<span style="color: #656565;">## </span><span style="color: #757575;">secret config, with passwords and naughty words</span>
-$ ck add emacs ~/.emacs.d/accounts.org -s
-<span style="color: #656565;">## </span><span style="color: #757575;">and another one for emacs</span>
-$ ck add emacs ~/.emacs.d/init.el
-
-<span style="color: #656565;"># </span><span style="color: #757575;">add tmux config</span>
-$ ck add tmux ~/.tmux.conf -p
-
-<span style="color: #656565;"># </span><span style="color: #757575;">list the configs</span>
-$ ck list tree
-$ ck list paths -t lisp
-$ ck list programs -t python
-$ ck list -p emacs
-
-<span style="color: #656565;"># </span><span style="color: #757575;">search the configs</span>
-$ ck search search-term
-$ ck search <span style="color: #bdbc61;">"\"search term with spaces\""</span>
-$ ck search <span style="color: #bdbc61;">"\("</span> <span style="color: #656565;">#</span><span style="color: #757575;">escape symbols</span>
-</pre>
</div>
-
-<p>
-The first command after typing <b>ck</b> is the action you wish to perform. Actions are
-a very important concept of ck. With an action you can initialize <b>ck</b>, add/delete
-configuration files to/from it, edit them, list them in various ways and search in their content.
-</p>
-
-<p>
-Actions expect their arguments in the order specified below. This is done to reduce the amount
-of flags one has to pass to ck.
-</p>
</div>
-<div id="outline-container-orgb40149d" class="outline-3">
-<h3 id="orgb40149d">ck configuration</h3>
-<div class="outline-text-3" id="text-orgb40149d">
-<p>
-ck uses sqlite to index the configuration files. The init
-action creates a <b>.ck</b> directory (under <code>$HOME</code>)
-in witch the <b>ckrc</b> and the <b>ckdb</b> reside. The first one contains
-the two directories described above while the other one is the
-sqlite db.
-</p>
-
-<p>
-One can have multiple config directories with different configurations
-each.
-</p>
-
+<div id="outline-container-org5727b06" class="outline-2">
+<h2 id="usage"><a id="org5727b06"></a>Usage</h2>
+<div class="outline-text-2" id="text-usage">
<p>
-Using the special keyword <b>config</b> (or <b>-c</b>) you can set the path
-in which ck will search for the <b>.ck</b> directory.
-</p>
-
-<p>
-You can prefix every action with this and ck will use the configuration
-directory of your choice.
+ck's goal is to assist with the configuration file management.
</p>
<p>
-Usage:
+This section is an example usage.
</p>
-<div class="org-src-container">
-<pre class="src src-sh">$ ck config ~/ ... <span style="color: #656565;"># </span><span style="color: #757575;">the default behaviour</span>
-
-<span style="color: #656565;"># </span><span style="color: #757575;">/someplace/else must exist or</span>
-<span style="color: #656565;"># </span><span style="color: #757575;">the action following it must be init</span>
-$ ck -c /someplace/else ...
-</pre>
-</div>
-</div>
</div>
-
-<div id="outline-container-org52aba1d" class="outline-3">
-<h3 id="org52aba1d">Actions</h3>
-<div class="outline-text-3" id="text-org52aba1d">
-</div>
-<div id="outline-container-org7ba72be" class="outline-4">
-<h4 id="org7ba72be">init</h4>
-<div class="outline-text-4" id="text-org7ba72be">
-<p>
-or i or -i
-</p>
-
-<p>
-init takes exactly 2 arguments.
-</p>
-
-<ul class="org-ul">
-<li><b>config_dir</b>: where all the configs will live</li>
-<li><b>secret_dir</b>: where all the secret configs will live</li>
-</ul>
-
-<p>
-Use init to initialize a new ck database.
-</p>
-
-<p>
-Usage:
-</p>
+<div id="outline-container-orgd2e5354" class="outline-3">
+<h3 id="orgd2e5354">Initialize</h3>
+<div class="outline-text-3" id="text-orgd2e5354">
<div class="org-src-container">
-<pre class="src src-sh"><span style="color: #656565;"># </span><span style="color: #757575;">initialize new ck</span>
-$ ck init /path_to/where_you_want/your_configs/to_be <span style="color: #bdbc61;">\</span>
- /path_to/the_secret/directory
-</pre>
-</div>
-</div>
-</div>
-
-<div id="outline-container-org9ae26ce" class="outline-4">
-<h4 id="org9ae26ce">add</h4>
-<div class="outline-text-4" id="text-org9ae26ce">
-<p>
-or a or -a
-</p>
-
-<p>
-Adds a configuration to the ck database.
-Add takes 2 to 4 arguments.
-</p>
-
-<ul class="org-ul">
-<li><b>program_name</b>: the name of the program you add a config to</li>
-<li><b>config_path</b>: the path to the config</li>
-<li>Optional: (order doesn't matter)
-<ul class="org-ul">
-<li><b>-p</b>: the config will be the primary (relevant on edit below)</li>
-<li><b>-s</b>: the config will be stored in the secret_dir</li>
-</ul></li>
-</ul>
-
-<p>
-Keep in mind:
-</p>
-<ul class="org-ul">
-<li>The config has to exist.</li>
-<li>If you are adding a config to a program already existing in ckdb make
-sure to use the same name.</li>
-<li>Each program can have only one primary config.</li>
-</ul>
+<pre class="src src-sh"><span class="org-builtin">cd</span> ~
+<span class="org-comment-delimiter"># </span><span class="org-comment">make the directories for the configs</span>
+$ mkdir -p configs/vc configs/sec
-<p>
-Usage:
-</p>
-<div class="org-src-container">
-<pre class="src src-sh"><span style="color: #656565;"># </span><span style="color: #757575;">add config to ck</span>
-$ ck add program_name config_path [-s] [-p]
+<span class="org-comment-delimiter"># </span><span class="org-comment">initialize new ck</span>
+$ ck init configs/vc configs/sec
</pre>
</div>
</div>
</div>
-<div id="outline-container-orgb4adc9b" class="outline-4">
-<h4 id="orgb4adc9b">list</h4>
-<div class="outline-text-4" id="text-orgb4adc9b">
-<p>
-or ls or l or -l
-</p>
-
-<p>
-List stuff ck knows about.
-</p>
-
-<p>
-You can use the keywords:
-</p>
-<ul class="org-ul">
-<li><b>paths</b>: to print all the paths ck tracks</li>
-<li><b>programs</b>: to print all the programs ck tracks</li>
-<li><b>-p progName</b>: (without the "&lt;&gt;") to print the paths of a specific program</li>
-</ul>
-
-<p>
-With the flag <b>-t</b> and then one of the follwing types one can change
-the way the list is printed:
-</p>
-<ul class="org-ul">
-<li><b>plain</b>: simple listing (default)</li>
-<li><b>python</b>: print like a python list</li>
-<li><b>lisp</b>: print like a lisp list</li>
-</ul>
-
-<p>
-Using the keyword <b>tree</b> ck can list the configurations under their
-corresponding program, in a treelike structure.
-</p>
-
-<p>
-Passing the <b>-a</b> flag will enable the listing of config attributes (secret or primary).
-It is best used with tree or plain paths.
-</p>
-
-<p>
-With the keyword <b>ckconf</b> ck will list it's own configuration values (in ckrc).
-</p>
-
-<p>
-Usage:
-</p>
+<div id="outline-container-orgfc9d01c" class="outline-3">
+<h3 id="orgfc9d01c">Add configs</h3>
+<div class="outline-text-3" id="text-orgfc9d01c">
<div class="org-src-container">
-<pre class="src src-sh"><span style="color: #656565;"># </span><span style="color: #757575;">list tree structure, with attributes</span>
-$ ck list tree -a
-<span style="color: #656565;"># </span><span style="color: #757575;">list paths in python</span>
-$ ck l paths -t python
-<span style="color: #656565;"># </span><span style="color: #757575;">list programs in lisp</span>
-$ ck ls programs -t lisp
-<span style="color: #656565;"># </span><span style="color: #757575;">list emacs' configurations [with attributes]</span>
-$ ck ls -p emacs [-a]
-<span style="color: #656565;"># </span><span style="color: #757575;">list bash configurations in lisp</span>
-$ ck ls -p bash -t lisp
-<span style="color: #656565;"># </span><span style="color: #757575;">list ck configuration</span>
-$ ck -l ckconf
+<pre class="src src-sh"><span class="org-comment-delimiter"># </span><span class="org-comment">add emacs configs</span>
+<span class="org-comment-delimiter">## </span><span class="org-comment">primary config</span>
+$ ck add emacs .emacs.d/orgconf.org -p
+<span class="org-comment-delimiter">## </span><span class="org-comment">secret config, with passwords and naughty words</span>
+$ ck add emacs .emacs.d/accounts.org -s
+<span class="org-comment-delimiter">## </span><span class="org-comment">and another one for emacs</span>
+$ ck add emacs .emacs.d/init.el
+
+<span class="org-comment-delimiter"># </span><span class="org-comment">add tmux config</span>
+$ ck add tmux .tmux.conf -p
+
+<span class="org-comment-delimiter"># </span><span class="org-comment">add X configs</span>
+$ ck add X .xinitrc
+$ ck add X .Xresources
+
+<span class="org-comment-delimiter"># </span><span class="org-comment">add ssh configs (secret)</span>
+$ ck add ssh .ssh/config -s -p
+$ ck add ssh .ssh/authorized_keys -s
+<span class="org-comment-delimiter"># </span><span class="org-comment">When running with sudo, we need to specify the ck config</span>
+<span class="org-comment-delimiter"># </span><span class="org-comment">location.</span>
+$ sudo ck -c /home/ckuser add ssh /etc/ssh/sshd_config -s
</pre>
</div>
</div>
</div>
-<div id="outline-container-org442a05c" class="outline-4">
-<h4 id="org442a05c">search</h4>
-<div class="outline-text-4" id="text-org442a05c">
-<p>
-or grep or s or -s
-</p>
-
-<p>
-Perform infile grep in all the configurations ck keeps track of.
-</p>
-
-<p>
-Takes one argument, the <b>search-term</b>.
-</p>
-
-<p>
-To search for terms with spaces you have to put them in quotes.
-</p>
-
-<p>
-Usage:
-</p>
+<div id="outline-container-orga6dee7d" class="outline-3">
+<h3 id="orga6dee7d">Using the ck actions</h3>
+<div class="outline-text-3" id="text-orga6dee7d">
<div class="org-src-container">
-<pre class="src src-sh"><span style="color: #656565;"># </span><span style="color: #757575;">search for parenthesis</span>
-$ ck search <span style="color: #bdbc61;">\(</span>
-<span style="color: #656565;"># </span><span style="color: #757575;">search term with spaces</span>
-$ ck grep <span style="color: #bdbc61;">"This is a space"</span>
-<span style="color: #656565;"># </span><span style="color: #757575;">both</span>
-$ ck s <span style="color: #bdbc61;">"(add 2 4)"</span>
-<span style="color: #656565;"># </span><span style="color: #757575;">and a normal one</span>
-$ ck -s alias
-</pre>
-</div>
-
-<p>
-If you want to use more advanced grep techniques or even
-a different pattern matching program you can do it like so:
-</p>
-
-<div class="org-src-container">
-<pre class="src src-sh"><span style="color: #656565;"># </span><span style="color: #757575;">with xargs</span>
-$ ck ls paths | xargs grep -E <span style="color: #bdbc61;">'A|B'</span>
-<span style="color: #656565;"># </span><span style="color: #757575;">or in bash</span>
-$ for i<span style="color: #5180b3;"> in</span> $(ck ls paths); <span style="color: #5180b3;">do</span> grep -E <span style="color: #bdbc61;">'A|B'</span> $<span style="color: #baba36;">i</span>; <span style="color: #5180b3;">done</span>
-<span style="color: #656565;"># </span><span style="color: #757575;">or in zsh</span>
-$ for i ($(ck ls paths)) grep -E <span style="color: #bdbc61;">'A|B'</span> $<span style="color: #baba36;">i</span>
-</pre>
-</div>
-</div>
-</div>
-
-<div id="outline-container-org6320932" class="outline-4">
-<h4 id="org6320932">edit</h4>
-<div class="outline-text-4" id="text-org6320932">
-<p>
-or e or -e
-</p>
-
-<p>
-Edit configurations with <code>$EDITOR</code>.
-</p>
-
-<p>
-Edit takes at least one and up to two arguments.
-</p>
+<pre class="src src-sh"><span class="org-comment-delimiter"># </span><span class="org-comment">list the configs in a treelike structure with basename only</span>
+$ ck list tree -b
+<span class="org-comment-delimiter"># </span><span class="org-comment">or with the full path &amp; attributes</span>
+$ ck list tree -a
-<p>
-The first argument is the <b>programName</b>. If the program has a primary configuration
-edit will open this. If the program has only one configuration edit will open it.
-If the program has more than 1 configurations and no primary, it will print the
-avaliable configurations and exit.
-</p>
+<span class="org-comment-delimiter"># </span><span class="org-comment">list only the paths in python or lisp like lists</span>
+$ ck list paths -t lisp
+$ ck list programs -t python -b -a
-<p>
-The second argument is the <b>configName</b>. If it exists it will open, else it will
-print the avaliable configurations and exit.
-</p>
+<span class="org-comment-delimiter"># </span><span class="org-comment">list emacs configs</span>
+$ ck list -p emacs
-<p>
-Usage:
-</p>
-<div class="org-src-container">
-<pre class="src src-sh"><span style="color: #656565;"># </span><span style="color: #757575;">suppose this is our ck instance</span>
-$ ck list tree -a
-emacs:
-|- init.el
-|- accounts.el [s]
-|- orgconf.org [p]
+<span class="org-comment-delimiter"># </span><span class="org-comment">search the configs</span>
+$ ck search Hostname
+$ ck search <span class="org-string">"search term with spaces"</span>
+<span class="org-comment-delimiter"># </span><span class="org-comment">escape symbols</span>
+$ ck search <span class="org-string">\(</span>
-<span style="color: #656565;"># </span><span style="color: #757575;">edit the primary emacs config</span>
+<span class="org-comment-delimiter"># </span><span class="org-comment">edit the primary config of emacs</span>
$ ck edit emacs
-
-<span style="color: #656565;"># </span><span style="color: #757575;">edit a specific emacs config, other than the primary</span>
-$ ck edit emacs accounts.el
+<span class="org-comment-delimiter"># </span><span class="org-comment">edit a non-primary config of ssh</span>
+$ ck e ssh authorized_keys
+<span class="org-comment-delimiter"># </span><span class="org-comment">edit a root config</span>
+$ sudo ck -c /home/ckuser e ssh sshd_config
+
+<span class="org-comment-delimiter"># </span><span class="org-comment">delete a program with all the configs</span>
+$ ck delete emacs
+<span class="org-comment-delimiter"># </span><span class="org-comment">or a specific config</span>
+$ ck del -c /home/ckuser/.emacs.d/init.el
+
+<span class="org-comment-delimiter"># </span><span class="org-comment">restore all links (on a new instalation)</span>
+$ ck restore all
+<span class="org-comment-delimiter"># </span><span class="org-comment">restore a program's links</span>
+$ ck r -p emacs
+
+<span class="org-comment-delimiter"># </span><span class="org-comment">get help for an action</span>
+$ ck h add
+$ ck --help e
</pre>
</div>
</div>
</div>
-
-<div id="outline-container-orgae8e7fb" class="outline-4">
-<h4 id="orgae8e7fb">restore</h4>
-<div class="outline-text-4" id="text-orgae8e7fb">
-<p>
-or r or -r
-</p>
-
-<p>
-Restore links.
-</p>
-
-<p>
-Given a working ck instance (ckdb + ckrc + directories in ckrc with configs)
-restore shall recreate the links from the config directories in ckrc
-back to their corresponding position when added in ck.
-</p>
-
-<p>
-It is useful for copying your configs to a new linux installation
-or restoring deleted links.
-</p>
-
-<p>
-It can either restore a specific program or all of them:
-</p>
-<div class="org-src-container">
-<pre class="src src-sh"><span style="color: #656565;"># </span><span style="color: #757575;">restore progName</span>
-ck restore -p progName
-<span style="color: #656565;"># </span><span style="color: #757575;">restore all</span>
-ck r all
-</pre>
</div>
-<p>
-Note:
-If ck tracks configs that are owned by root, simply running
-`ck restore &#x2026;` will fail due to permissions. To remedy this, ck will alter the
-owner and group of a link to match the one in the ckrc directories.
-Thus, running `sudo ck -c <i>home/myuser</i>.ck restore ..` will restore
-the root user's links as it should and the user links will have
-the user as the owner instead of the root.
-</p>
-
-<p>
-ck checks that the configs exist and that the location for the link
-is avaliable before making any links. However, in the even that symlink
-fails for some other reason, the process will stop as is. Make sure you
-take care of the already created links, if that's the case.
-</p>
-</div>
-</div>
-</div>
-</div>
-<div id="outline-container-orgf44bdc3" class="outline-2">
-<h2 id="orgf44bdc3">manpage</h2>
-<div class="outline-text-2" id="text-orgf44bdc3">
+<div id="outline-container-org9df6fcc" class="outline-2">
+<h2 id="manpage"><a id="org9df6fcc"></a>manpage</h2>
+<div class="outline-text-2" id="text-manpage">
<!-- Creator : groff version 1.22.3 -->
-<!-- CreationDate: Sun Oct 28 13:22:50 2018 -->
+<!-- CreationDate: Mon Oct 29 17:20:18 2018 -->
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
@@ -933,6 +650,7 @@ take care of the already created links, if that's the case.
<a href="#NAME">NAME</a><br>
<a href="#SYNOPSIS">SYNOPSIS</a><br>
<a href="#DESCRIPTION">DESCRIPTION</a><br>
+<a href="#CONFIGURATION">CONFIGURATION</a><br>
<a href="#OPTIONS">OPTIONS</a><br>
<a href="#ACTIONS">ACTIONS</a><br>
<a href="#EXIT STATUS">EXIT STATUS</a><br>
@@ -968,11 +686,12 @@ ck add</b> <i>PROGRAM_NAME CONFIG_PATH</i> [<b>&minus;p</b>]
ck delete</b>
<i>PROGRAM_NAME</i>|{<b>&minus;c&nbsp;</b><i>CONFIG_PATH</i>}
<b><br>
-ck list tree&nbsp;</b>[<b>&minus;a</b>] <b><br>
+ck list tree&nbsp;</b>[<b>&minus;a</b>] [<b>&minus;b</b>]
+<b><br>
ck list</b>
{<b>-p&nbsp;</b><i>PROGRAM_NAME</i>}|<b>programs</b>|<b>paths&nbsp;</b>[<b>&minus;t</b>
{<b>plain</b>|<b>python</b>|<b>lisp</b>}] [<b>&minus;a</b>]
-<b><br>
+[<b>&minus;b</b>] <b><br>
ck list ckconf <br>
ck edit</b>
<i>PROGRAM_NAME&nbsp;</i>[<i>CONFIG_BASENAME</i>] <b><br>
@@ -1015,6 +734,26 @@ you can sync the <i>VERSION_CONRTOL_DIR</i> and
given these two directories and the correspondig rc file and
database.</p>
+<h2>CONFIGURATION
+<a name="CONFIGURATION"></a>
+</h2>
+
+
+<p style="margin-left:11%; margin-top: 1em"><b>ck</b> uses
+<b>sqlite</b> to index the configuration files. The <b>init
+action</b> by default creates a directory named <i>.ck</i>
+under <i>$HOME</i> in witch the <i>ckrc</i> and <i>ckdb</i>
+files reside. See the <b>FILES</b> section for more
+details.</p>
+
+<p style="margin-left:11%; margin-top: 1em">One can have
+multiple <b>config directories</b> with different
+configurations each. Using the
+<b>config&nbsp;</b>or&nbsp;<b>&minus;c</b> option one can
+set the path in which ck will search for <i>ckrc</i> and
+<i>ckdb</i>. See the <b>OPTIONS</b> section for more
+details.</p>
+
<h2>OPTIONS
<a name="OPTIONS"></a>
</h2>
@@ -1204,11 +943,11 @@ List programs, configs and ck configuration values.</p>
<p style="margin-left:11%; margin-top: 1em"><b>USAGE</b></p>
<p style="margin-left:14%;"><b>ck list
-tree&nbsp;</b>[<b>&minus;a</b>] <b><br>
+tree&nbsp;</b>[<b>&minus;a</b>] [<b>&minus;b</b>] <b><br>
ck list</b>
{<b>-p&nbsp;</b><i>PROGRAM_NAME</i>}|<b>programs</b>|<b>paths&nbsp;</b>[<b>&minus;t</b>
{<b>plain</b>|<b>python</b>|<b>lisp</b>}] [<b>&minus;a</b>]
-<b><br>
+[<b>&minus;b</b>] <b><br>
ck list ckconf</b></p>
@@ -1269,6 +1008,12 @@ or <b>lisp</b> to print it like a lisp list.</p>
<b>[root]</b> if the file is owned by the root user.</p>
+<p style="margin-left:14%; margin-top: 1em"><b>&minus;b</b></p>
+
+<p style="margin-left:17%;">Print the <b>config</b>
+basename instead of the full path.</p>
+
+
<p style="margin-left:11%; margin-top: 1em"><b>EXAMPLES</b></p>
<p style="margin-left:14%;">$ ck list tree -a <br>
@@ -1374,6 +1119,32 @@ installation or <b>restoring</b> deleted links. It can
either <b>restore</b> a specific <b>program</b> or all of
them.</p>
+<p style="margin-left:11%; margin-top: 1em"><b>NOTE</b>: If
+<b>ck</b> tracks <b>configs</b> that are owned by root,
+simply running</p>
+
+<p style="margin-left:14%;">$ ck restore ...</p>
+
+<p style="margin-left:11%;">will fail due to permissions.
+To remedy this, <b>ck</b> will alter the
+<b>owner&nbsp;</b>and&nbsp;<b>group</b> of a link to match
+the one in the original <b>config</b> file. Thus,
+running</p>
+
+<p style="margin-left:14%;">$ sudo ck -c /home/ckuser/.ck
+restore ...</p>
+
+<p style="margin-left:11%;">will <b>restore</b> the root
+user&rsquo;s links as it should and the user links will have
+the user as the owner instead of the root.</p>
+
+<p style="margin-left:11%; margin-top: 1em"><b>ck</b>
+checks that the <b>configs</b> exist and that the location
+for the link is avaliable before making any links. However,
+in the even that <b>symlink</b> 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&rsquo;s the case.</p>
+
<p style="margin-left:11%; margin-top: 1em"><b>USAGE</b></p>
@@ -1514,7 +1285,7 @@ flags</b>: @CMAKE_C_FLAGS@</p>
</div>
</div>
<div id="postamble" class="status">
-<p class="date">Created: 2018-10-28 Sun 13:22</p>
+<p class="date">Created: 2018-10-29 Mon 17:20</p>
<p class="validation"><a href="http://validator.w3.org/check?uri=referer">Validate</a></p>
</div>
</body>