diff options
-rw-r--r-- | ck.1 | 453 |
1 files changed, 269 insertions, 184 deletions
@@ -2,49 +2,94 @@ .SH NAME ck \- manage configuration across the system .SH SYNOPSIS -.B ck -.RB [ \-v | \-\-verbose ] -.RB [ \-c | \-\-config -.IR DIR ] +.SY ck +.OP \-v\fR|\fB\-\-verbose +.OP \-c\fR|\fB\-\-config DIR .IR action \ [.\|.\|.] -.br -.B ck -.RB [ version | \-\-version ] -.br -.B ck init +.YS +.ns +.SY ck +.OP version\fR|\fB\-\-version +.YS +\" Init +.SY ck +.B init .I VERSION_CONTROL_DIR SECRET_DIR -.br -.B ck add +.YS +\" Add +.SY ck +.B add .I PROGRAM_NAME CONFIG_PATH -.RB [ \-p ] -.RB [ \-s ] -.br -.B ck delete -.IR PROGRAM_NAME | \fR{\fB\-c \ \fICONFIG_PATH\fR} -.br -.B ck list -.BR tree \ [ \-a ] -.RB [ \-b ] -.br -.B ck list -.RB { -p \ \fIPROGRAM_NAME\fR}\fR| programs | paths \ [ \-t -.RB { plain | python | lisp } \fR] -.RB [ \-a ] -.RB [ \-b ] -.br -.B ck list ckconf -.br -.B ck edit -.IR PROGRAM_NAME \ [ CONFIG_BASENAME ] -.br -.B ck search +.OP \-p +.OP \-s +.YS +\" Delete +.SY ck +.BI delete \ PROGRAM_NAME +.YS +.ns +.SY ck +.B delete \-c +.I CONFIG_PATH +.YS +\" List +.SY ck +.B list tree +.OP \-a +.OP \-b +.YS +.ns +.SY ck +.B list +.BI \-p \ PROGRAM_NAME +.OP \-t list-type +.OP \-a +.OP \-b +.YS +.ns +.SY ck +.B list +.B programs +.OP \-t list-type +.OP \-a +.OP \-b +.YS +.ns +.SY ck +.B list +.B paths +.OP \-t list-type +.OP \-a +.OP \-b +.YS +.ns +.SY ck +.B list ckconf +.YS +\" Edit +.SY ck +.B edit +.I PROGRAM_NAME +.RI [ CONFIG_BASENAME ] +.YS +\" Search +.SY ck +.B search .I SEARCH_TERM -.br -.B ck restore -.IR PROGRAM_NAME | \fBall -.br -.B ck help -.I action +.YS +\" Restore +.SY ck +.B restore \-p +.I PROGRAM_NAME +.YS +.ns +.SY ck +.B restore all +.YS +\" Help +.SY ck +.BI help \ action +.YS .SH DESCRIPTION .B ck manages configuration files in a Linux system. To that end it provides an @@ -89,7 +134,6 @@ and You can also .B restore the links given these two directories and the correspondig rc file and database. - .SH CONFIGURATION .B ck uses @@ -159,7 +203,7 @@ section above. Each .B action takes a number of arguments and flags. -.SS "Initialize ck" +.SS "INITIALIZE" Create the .B ck database @@ -169,8 +213,13 @@ and initialize it. Create the ck config file and add the directory paths to it. .TP 2 .B USAGE -.B ck init +.ns +.RS 2 +.SY ck +.B init .I VERSION_CONTROL_DIR SECRET_DIR +.YS +.RE .TP 2 .B ALIASES .BR init , \ i , \ \-i @@ -199,7 +248,7 @@ flag in $ ck init /home/ckuser/configs/vc home/ckuser/configs/sec $ ck i configs/vc configs/sec .EE -.SS "Add config" +.SS "ADD CONFIG" Add a .B config to the database @@ -220,10 +269,15 @@ will open the by default. .TP 2 .B USAGE -.B ck add +.ns +.RS 2 +.SY ck +.B add .I PROGRAM_NAME CONFIG_PATH -.RB [ \-p ] -.RB [ \-s ] +.OP \-p +.OP \-s +.YS +.RE .TP 2 .B ALIASES .BR add , \ a , \ \-a @@ -274,7 +328,7 @@ $ ck add emacs ~/.emacs.d/accounts.org -s ## another one for emacs $ ck add emacs ~/.emacs.d/init.el .EE -.SS "Delete config" +.SS "DELETE CONFIG" Delete a .B config or a @@ -283,108 +337,130 @@ from the database .RI ( ckdb )\fR. This will not touch the actual file and link. It is up to the user to handle it. -.P +.TP 2 .B USAGE -.in +.2i -.B ck delete -.IR PROGRAM_NAME | \fR{\fB\-c \ \fICONFIG_PATH\fR} -.P +.ns +.RS 2 +.SY ck +.BI delete \ PROGRAM_NAME +.YS +.ns +.SY ck +.B delete \-c +.I CONFIG_PATH +.YS +.RE +.TP 2 .B ALIASES -.in +.2i .BR delete , \ del , \ d , \ \-d -.P +.TP 2 .B ARGUMENTS -.in +.2i +.ns +.RS 2 +.TP 21 .I PROGRAM_NAME -.br -.in +.2i Delete the .B program and all it's .BR configs . -.P -.in +.2i +.TP 21 .BI \-c \ CONFIG_PATH -.in +.2i Delete the .BR config . This has to be the full path of the link as shown by the .B list action\fR. -.P +.RE +.TP 2 .B EXAMPLES -.br +.EX $ ck delete emacs -.br $ ck del -c /home/ckuser/.emacs.d/init.el -.SS "List" +.EE +.SS "LIST VALUES" List programs, configs and ck configuration values. -.P +.TP 2 .B USAGE -.br -.in +.2i -.B ck list -.BR tree \ [ \-a ] -.RB [ \-b ] -.br -.B ck list -.RB { -p \ \fIPROGRAM_NAME\fR}\fR| programs | paths \ [ \-t -.RB { plain | python | lisp } \fR] -.RB [ \-a ] -.RB [ \-b ] -.br -.B ck list ckconf -.br -.P +.ns +.RS 2 +.SY ck +.B list tree +.OP \-a +.OP \-b +.YS +.ns +.SY ck +.B list +.BI \-p \ PROGRAM_NAME +.OP \-t list-type +.OP \-a +.OP \-b +.YS +.ns +.SY ck +.B list +.B programs +.OP \-t list-type +.OP \-a +.OP \-b +.YS +.ns +.SY ck +.B list +.B paths +.OP \-t list-type +.OP \-a +.OP \-b +.YS +.ns +.SY ck +.B list ckconf +.YS +.RE +.TP 2 .B ALIASES -.in +.2i .BR list , \ ls , \ l , \ -ls , \ \-l -.P +.TP 2 .B ARGUMENTS -.in +.2i +.ns +.RS 2 +.TP 21 .B tree -.in +.2i List .B programs with their .B configs in a tree like structure. -.P -.in +.2i +.TP 21 .B paths -.in +.2i List all the .B config paths .B ck keeps track of. -.P -.in +.2i +.TP 21 .B programs -.in +.2i List all the .B programs ck keeps track of. -.P -.in +.2i +.TP 21 .BI \-c \ PROGRAM_NAME -.in +.2i List all the .B configs of .IR PROGRAM_NAME . -.P -.in +.2i +.TP 21 .BI ckconf -.in +.2i List the .B ck configuration values, like the .IR VERSION_CONTROL_DIR \ and \ SECRET_DIR . -.P +.RE +.TP 2 .B FLAGS -.in +.2i -.B \-t -.in +.2i +.ns +.RS 2 +.TP 21 +.BI \-t \ type Set the type of the .BR list . Can be either @@ -394,12 +470,10 @@ Can be either to print it like a python array or .B lisp to print it like a lisp list. -.P -.in +.2i +.TP 21 .B \-a -.in +.2i -Add attributes to the listing (when aplicable). -The attributes are +Show attributes to the listing (when aplicable). +These are .B [s] for .BR secret , @@ -409,24 +483,21 @@ for and .B [root] if the file is owned by the root user. -.P -.in +.2i +.TP 21 .B \-b -.in +.2i Print the .B config basename instead of the full path. -.P +.RE +.TP 2 .B EXAMPLES -.in +.2i +.EX $ ck list tree -a -.br $ ck list paths -t lisp -.br $ ck list programs -t python -.br $ ck list -p emacs -.SS "Edit configs" +.EE +.SS "EDIT CONFIGS" Edit a .B config stored in @@ -450,22 +521,25 @@ Whenever there is ambiguity, a list of possible .B configs will be shown. -.P +.TP 2 .B USAGE -.br -.in +.2i -.B ck edit -.IR PROGRAM_NAME \ [ CONFIG_BASENAME ] -.br -.P +.ns +.RS 2 +.SY ck +.B edit +.I PROGRAM_NAME +.RI [ CONFIG_BASENAME ] +.YS +.RE +.TP 2 .B ALIASES -.in +.2i .BR edit , \ e , \ \-e -.P +.TP 2 .B ARGUMENTS -.in +.2i +.ns +.RS 2 +.TP 21 .I PROGRAM_NAME -.in +.2i The name of the .B program to be edited. If the @@ -475,10 +549,8 @@ has only one or you want to edit the .B primary one, no further action is required. -.P -.in +.2i +.TP 21 .I CONFIG_BASENAME -.in +.2i The basename of the .B config to be edited. This has to follow the @@ -488,47 +560,53 @@ name. It is only needed when editing a other than the .B primary one. -.P +.RE +.TP 2 .B EXAMPLES -.in +.2i +.EX $ ck edit emacs -.br $ ck e tmux .tmux.conf -.SS "Search configs" +.EE +.SS "SEARCH CONFIGS" Grep through the configs. This .B action is equivalent to this: -.P +.br +.RS 2 $ ck ls paths | xargs grep -H -n "search term" -.P +.RE +.br Thus for more advanced search through the .B configs one can use other programs and replace grep in the command above. -.P +.TP 2 .B USAGE -.br -.in +.2i -.B ck search +.ns +.RS 2 +.SY ck +.B search .I SEARCH_TERM -.br -.P +.YS +.RE +.TP 2 .B ALIASES -.in +.2i .BR search , \ grep , \ s , \ \-s -.P +.TP 2 .B ARGUMENTS -.in +.2i +.ns +.RS 2 +.TP 21 .I SEARCH_TERM -.in +.2i The term you wish to search for. If it's a phrase enclose it in "". If it's a special character you can escape it with \\ (backslash). -.P +.RE +.TP 2 .B EXAMPLES -.in +.2i +.EX $ ck search "search term" -.br $ ck search "\\(require" -.SS "Restore configs" +.EE +.SS "RESTORE CONFIGS" Given a working .B ck instance (\fIckdb \fR+ \fIckrc\fR + directories in \fIckrc\fR with @@ -556,9 +634,9 @@ tracks .B configs that are owned by root, simply running .br -.in +.2i +.RS 2 $ ck restore \.\.\. -.in +.RE .br will fail due to permissions. To remedy this, .B ck @@ -568,9 +646,9 @@ of a link to match the one in the original .B config file. Thus, running -.in +.2i +.RS 2 $ sudo ck -c /home/ckuser/.ck restore \.\.\. -.in +.RE will .B restore the root user's links as it should and the user links will have @@ -584,68 +662,75 @@ is avaliable before making any links. However, in the even that .B 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. -.P +.TP 2 .B USAGE -.br -.in +.2i -.B ck restore -.IR PROGRAM_NAME | \fBall -.br -.P +.ns +.RS 2 +.SY ck +.B restore \-p +.I PROGRAM_NAME +.YS +.ns +.SY ck +.B restore all +.YS +.RE +.TP 2 .B ALIASES -.in +.2i .BR restore , \ r , \ \-r -.P +.TP 2 .B ARGUMENTS -.in +.2i +.ns +.RS 2 +.TP 21 .I PROGRAM_NAME -.in +.2i The name of the .B program to be restored. -.P -.in +.2i +.TP 21 .B all -.in +.2i Restore all .B programs ck keeps track of. -.P +.RE +.TP 2 .B EXAMPLES -.in +.2i +.EX $ ck restore all -.br $ ck restore -p emacs -.SS "Get help" +.EE +.SS "GET HELP" Get help for any given .B action from the command line. -.P +.TP 2 .B USAGE -.br -.in +.2i -.B ck help -.I action -.P +.ns +.RS 2 +.SY ck +.BI help \ action +.YS +.RE +.TP 2 .B ALIASES -.in +.2i .BR help , \ h , \ \-\-help , \ -h , \ \-? -.P +.TP 2 .B ARGUMENTS -.in +.2i +.ns +.RS 2 +.TP 21 .I action -.in +.2i Any .B action alias you wish to get help for. -.P +.RE +.TP 2 .B EXAMPLES -.in +.2i +.EX $ ck help add -.br $ ck h d -.br $ ck --help ls +.EE .SH EXIT STATUS .B ck shall return 0 if the action was completed without an error, -1 otherwise |