Quantcast
Channel: FedoraForum.org
Viewing all articles
Browse latest Browse all 36122

[SOLVED] Generating Manpages using a script, problems with formatting

$
0
0
Heyas

For over a year now i've been using a script to parse all files of a folder for function definitions and write them into a file.
Anyways, in the need of documenting the scripts for one during the usage and for two as seperate documentions, i thought to extend this script to generate (very basic) manpages automaticly.

1) During the usage of my scripts, each new section (which is a folder) looks for:
* .../section/default.info
* .../section/default.help
* Also i'm on going to support the -h argument to all the scripts.

2) So while extending that script, i'll be using those 3 methods from above.

Anyway, the problem is not generating the file, or get the content...
Its how the content looks like, so messed up.
I bet i have forgotton something, please have a look.

mancat.jpg: is how the manpages are created, and the top of cat'ng one:
manparagraphs.jpg: is how the created manpage actualy looks like.

The fully generated file looks like:
Code:

.TH net 1 "2013 06 03" "sea's Script Tools 0.7.6"
.SH Section: /usr/share/script-tools/UI_CLI/net
.SH nas -h
.PP
nas (1.0)
               
Ụsage: st net nas [ LABEL ] [-h|-c|-e|-s] [ m|u ]
               
Info: This script requires root access to u/mount.
               
        -h        Displays this screen
               
        -c        Shows the credential file
               
        -e        Edit the configuration file
               
        -s        Shows the configuration file
               
        m|mount        Mount share from NAS to local.
               
        u|umount        Unmounts share.
               
Returns (from the last displayed):
               
        0        OK
               
        1        missing rights
               
        2        Device Down
               
        99        help screen
.PP
.SH Section: net help
Arguments for sub entries: st net
NAS:          LABEL      c|l|ma|ms|n
 
nas c:        Connect to nas (console)
nas l:        List shares on nas
nas ma:      Mounts all shares from nas (mountall)
nas ms:      Mount only selected share from nas (mountsingle)
nas n:        Adds a new nas label
.SH yt -h
.PP
st net yt (0.7)
               
Ụsage: yt [-h] [-s] [-pl] [-i] [-lvf] [URL]
               
        -h        Displays this screen
               
        -s        Download video and exports to audiofile
               
        -pl        Downloads every item of Playlist (Reckognize ??)
               
        -i        Downloads additional info for video.
               
        -lv        List Video Formats for URL
               
               
Returns (from the last displayed):
               
        0        OK
               
        1        BAD
               
        99        help screen
.PP
.SH Section: net help
Some ideas i have to play with networks.
stnm tries to handle wifi and/or wired internet connections without networkmanager.
yt requires urls like: http://www.youtube.com/?v=a9hflkn4 or copy only the code of v=.

Anyone got an idea of whats my issue with the proper display of the helpscreen please?

EDIT:
Oh yeah, sorry... the concerning code:
Code:

                                hlp=$(source ${path[$C]}/${fn[$C]} -h)
                                echo -e ".PP\n$hlp\n.PP" | grep -v '#' >> "$outfile"


Attached Thumbnails
Click image for larger version

Name:	mancat.jpg
Views:	N/A
Size:	159.5 KB
ID:	25090   Click image for larger version

Name:	manparagraphs.jpg
Views:	N/A
Size:	158.9 KB
ID:	25091  

Viewing all articles
Browse latest Browse all 36122

Trending Articles