GithubHelp home page GithubHelp logo

Improve help message and arguments about am HOT 15 CLOSED

zen0bit avatar zen0bit commented on September 22, 2024
Improve help message and arguments

from am.

Comments (15)

ivan-hc avatar ivan-hc commented on September 22, 2024 1

now, we can focus on this

from am.

ivan-hc avatar ivan-hc commented on September 22, 2024 1

In the meantime, I've restored something like the function you've removed the other day.

open your help.am module and replace the last line

_help

with

case "$2" in
	'')	_help | less;;
	'--less')
		_help_body  | sed 's/	//g' | sed 's/#/\r/g' | sed 's/_/-/g' | grep -v -- "SYNOPSIS\|{PROGRAM}\|^--[a-z]" | sed 's/DESCRIPTION://g' | sed 's/.\n\n//g' | less;;
esac

do whatever you want with it. Improve it as much as possible.

I give you permission 👍

from am.

ivan-hc avatar ivan-hc commented on September 22, 2024 1

sorry, I can forget it. I've based my choices on my concept of "easy", and its not the same as you.

from am.

ivan-hc avatar ivan-hc commented on September 22, 2024 1

I'd like to add a tinyer message, like the one I did for Termux, time ago, I've no problems with that, if you wish it

about the options names, I've not much fantasy (also "AM" was named so because I had no fantasy, at time)

from am.

zen0bit avatar zen0bit commented on September 22, 2024

it's why using functions are usefull
They are easily transferable and reusable
why not make LEGO from your code?

function show_os_info() {
     while getopts ":12345" opt; do
        case $opt in
          1) os_info "${2}" | cut -d'|' -f1;;
          2) os_info "${2}" | cut -d'|' -f2;;
          3) os_info "${2}" | cut -d'|' -f3;;
          4) os_info "${2}" | cut -d'|' -f4;;
          5) os_info "${2}" | cut -d'|' -f5;;
          *) echo "Wrong choice!" && exit 1;;
        esac
    done
}

And then just build from bricks (functions)

from am.

ivan-hc avatar ivan-hc commented on September 22, 2024

I did this before you removed the option for Termux with your PR because "not needed anymore".

However, I would keep the "help" as is, because some people are really stupid and still need to understand how to work with options and sub-options, now that we have them too. The CLI has been improved.

All we can do is to restore what I did for you (and you removed) by using case, with sub-options, to show more or less info. That's all.

from am.

zen0bit avatar zen0bit commented on September 22, 2024

I did this before you removed the option for Termux with your PR because "not needed anymore".

However, I would keep the "help" as is, because some people are really stupid and still need to understand how to work with options and sub-options, now that we have them too. The CLI has been improved.

All we can do is to restore what I did for you (and you removed) by using case, with sub-options, to show more or less info. That's all.

Arguments? (getopts)

from am.

ivan-hc avatar ivan-hc commented on September 22, 2024

in the meantime, have you seen what I did at #444 with the installation process?

Let close old issues before bombing me with all thse notifications 🤒

from am.

ivan-hc avatar ivan-hc commented on September 22, 2024

about to have options shorter such as -fl instead of -f --less (I don't even remember if we have this), where ir the problem if we have bash-completion enabled? Also, this is not PacMan or APT but a mix of the two in term of options... why in PacMan they use "-S" (with S uppercased) instead of "-i" to install things? And why in APT we need to write "install" instead of "-i"? This is the mix I wanted to use. "-i" is more intuitive for a newbie that want to "install" something.

And sub-options? I think that its easier talking normally instead of using always codes. You talk too much as a developer, and I'm not a developer. I want something easier to remember, or at least "intuitive". If I want to sort something "by name" in "-f", "--byname" is easier to remember, and bash completion recognizes it if you write "--b".

Your way to look this stuff is too complicate, also for me. I want to remember the things, and if I don't remember them... I want to guess, and my guessing must come from an intuitive approach. This is why I wrote "AM" and wrote (in the description) "easy to use like APT and powerful like PacMan": is more intuitive to search packages with "apt search" instead of "-Ss" (also if the latter is more brief).

This is my point of view.

from am.

ivan-hc avatar ivan-hc commented on September 22, 2024

I don't like these technicisms.

Also, sometime the descriptions are not so easy to understand, by splitting options into a section, suboptions into another... more often without an example or a more detailed description that must be good enough to let a kid understand what is doing. This is why the description looks more like a real guide. I want to guide the user without him have to contact me on Reddit or open issues on issues without reading the README.

In fact, whe you install AM for the first time, the first suggestion is "run am -h"

From that moment on, the user must have a detailed guide into a terminal emulator... with all separators.

from am.

ivan-hc avatar ivan-hc commented on September 22, 2024

In brief, the "help" message is something too much precise and popular for some IT skilled and Elite developers like you. What you see too much obvious.... is not for the newbies. And AM is wrote for newbies.

from am.

zen0bit avatar zen0bit commented on September 22, 2024

apt or pacman or xbps commands are just matter of choice

could be anything

i still thinking that -fb is easier to read/write or complete than -f --by-name

-f Still just -f
-fn instead of -f --by-name
-fl = Files without version numbers

-i
-id instead of -i --debug
-if instead of -i --force-latest

Leave one of (--firejail --sandbox)

Also is bit strange some options are dashed some aren't

easy to remember

from am.

zen0bit avatar zen0bit commented on September 22, 2024

All my opened issues are more question or proposals then really issues or bugs

I thought about that and I will there don't clutter issues with my never ending questions 😉
From now on

I will try "Not really issue" put in discussions section instead
PS: This could be closed as solved (nope?)
I told what I want
I have permissions and rest up to you...

from am.

zen0bit avatar zen0bit commented on September 22, 2024

Good name
In simplicity is power

Hard to forget
How was that great app called?
AM or FM?

from am.

ivan-hc avatar ivan-hc commented on September 22, 2024

in the database we have an app called "m"

https://github.com/martin-azpillaga/M

from am.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.