WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: pseudo man pages (quick and dirty using links)  (Read 1528 times)

Offline kroovy

  • Newbie
  • *
  • Posts: 2
pseudo man pages (quick and dirty using links)
« on: June 18, 2023, 03:41:10 PM »
hi, i'm a tiny core learner

i was really missing man pages in tcl, so i came up with this:

Code: [Select]
function man () {
        DUMP="$(links -dump https://man.openbsd.org/OpenBSD-current/man1/${1}.1)"
        STARTING_LINE=$(echo "$DUMP" | awk '{printf("%d %s\n", NR, $0)}' | grep "General Commands Manual" | awk '{ print $1 }')
        echo "$DUMP" | awk "{if(NR>=${STARTING_LINE}) print \$0}" | less
}

the function filters the first ~114 lines (= all lines above "General Commands Manuel").
maybe someone is interested in this pseudo man pages attempt.

install:
  • install the package links.tcz
    (tce-load -wi links.tcz)
  • put the above code in your ~/.ashrc

P.S. let me know if you apreciate this post or if it is contrary to the spirit of this forum - still new and a learner

Offline CNK

  • Wiki Author
  • Sr. Member
  • *****
  • Posts: 278
Re: pseudo man pages (quick and dirty using links)
« Reply #1 on: June 18, 2023, 07:53:29 PM »
Looks nice, but I'd at least try to find a source of man pages that's for Linux instead of BSD.

I mainly use the Debian man pages and have them set up as a search option in Dillo. The search string is like this, where "%s" is replaced by the command you want a manual for:
Code: [Select]
https://dyn.manpages.debian.org/jump?q=%s

But I'm still not happy with this because the version of programs in current Debian packages is usually different, so there's still scope for confusion. This can be particularly annoying if you're witing a script and only notice that some option or other wasn't present in the version available for TC after you've finished.

One day I'll write a system that automatically tries a three prong approach:
  • Check for a -doc.tcz extension in the repo and read the man page from that.
  • Find the source code from somewhere in the repo (this is a awkward), download it, find a man page inside, and make a -doc.tcz extensions, then do the above.
  • Check various man page websites, extract the software versions that their man pages are for (the method for this would probably need to be specific for each website), and show the ones closest to the version in Tiny Core (according to the .info file for the associated extension).

The second and third prongs would be rather annoying to implement, but just the first one alone would be extremely limited because too few extensions have matching -doc.tcz extensions. It's a pain.

aus9

  • Guest
Re: pseudo man pages (quick and dirty using links)
« Reply #2 on: June 18, 2023, 09:39:41 PM »
man-pages.tcz is supposed to be any arch.
its in 14.x TC64 which Tinycore or release are you using?

http://tinycorelinux.net/14.x/x86_64/tcz/src/man-pages/build-man-pages.sh

as the dev team may not have time to upload to every release or arch just use your web browser to download the TC64 TCE by clicking link if you like
http://tinycorelinux.net/14.x/x86_64/tcz/man-pages.tcz

err I hope this is not a breach of the rules as it is an official binary?
« Last Edit: June 18, 2023, 09:49:41 PM by aus9 »

Offline kroovy

  • Newbie
  • *
  • Posts: 2
Re: pseudo man pages (quick and dirty using links)
« Reply #3 on: June 19, 2023, 04:19:44 AM »
Sorry, I empebzzled that I'm Using PiCore.

I might have caused some confusion here.  :-[

aus9

  • Guest
Re: pseudo man pages (quick and dirty using links)
« Reply #4 on: June 19, 2023, 05:59:27 AM »
I am easily confused but repeat piCore 32 bit should still be able to use an any arch TCE.
I  am on  piCore64...can you search for a man page viewer in Apps?
I just downloaded the TC64 any arch TCE and "less" command kind of works without man-db. I am sure there are others