Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add automated CLI demonstrations #262

Merged
merged 6 commits into from
Dec 25, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions examples/demo/config.sh.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Common config for demo scripts
configure() {
DELAY=0.12
DELAY_SEP=0.3
DELAY_PROMPT=0.6
# No messages/warnings in the current versions of the scripts
# COLOR_WARNING='1;91'
# COLOR_MESSAGE='1;32'
# If you want to use the colorful prompt
TUTERM_NAME='PyFunceble-demo'
}

prompt() {
# A more colorful prompt
# echo -ne "\033[1;94m$TUTERM_NAME \033[1;35m$(pwd | sed "s:$HOME:~:")\033[0;33m $\033[0m "
echo -n '[funilrys@funilrys PyFunceble]$ '
}
14 changes: 14 additions & 0 deletions examples/demo/landing1.tut
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env tuterm

source config.sh.in

run() {
echo
c PyFunceble -a -d github.com
Copy link
Contributor

@spirillen spirillen Oct 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest using example.org (for good domains), example.com (for bad domains and example.org (for neutral domains) this would follow the practice in the docs. (https://github.com/funilrys/PyFunceble/blame/dev/docs/usage/terminal.rst#L9-L10)

In one of these examples I will suggest adding two domains.

Example

c pyfunceble -a -d example.com example.org

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally think microsoft_google.com is better as a "bad" domain because it's more intuitive. No one expects microsoft and google to share a domain. But example.com wouldn't strike anyone as a bad domain until they actually check it. I do agree that example.org a suitable "good" domain.

This is just my opinion, and I will implement it the way you and the other maintainers want it of course.

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You nailed it @veracioux! That's actually why I choose microsoft_google.com haha.

Copy link
Contributor

@spirillen spirillen Oct 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can't say I in anyway disagree with any of you. It was just for the sake of the continually flow.

It also could be a help to new users, if naming is related to the docs, so people better can compare the readden word with the video.

c PyFunceble -a -d github.com --no-whois # TODO doesn't work
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The --no-whois is deprecated and replaces by --whois-lookup as also mentioned here #260 (comment) there have been several changes since the lasts recordings.

Copy link
Contributor Author

@veracioux veracioux Oct 17, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@spirillen @funilrys I did see the comment. I was just a bit confused that the --whois-lookup option actually disables whois. The option name suggests otherwise. Personally I think that --no-whois is a better name for the option. Maybe I'm doing something wrong. (The version of pyfunceble I used for the demos is 4.0.1)

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@veracioux, it's because --whois-lookup will switch what people define in their configuration file (lookup.whois).

So if the lookup.whois index is set to true, using --whois-lookup will switch the internal value to false.
If the lookup.whois index is set to false, using --whois-lookup will switch the internal value to true.

c PyFunceble -a -d githuuub.com
c PyFunceble -a -d microsoft_google.com
c exit
}

# vim: filetype=sh
13 changes: 13 additions & 0 deletions examples/demo/landing2.tut
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/usr/bin/env tuterm

source config.sh.in

run() {
echo
c PyFunceble -d 192.168.178.60 # TODO doesn't print the status
c PyFunceble -d 192.168.178.250 # TODO doesn't print the status
c PyFunceble -d 192.168.178.259
c exit
}

# vim: filetype=sh
14 changes: 14 additions & 0 deletions examples/demo/landing3.tut
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env tuterm

source config.sh.in

run() {
echo
c PyFunceble -u https://github.com/funilrys
c PyFunceble -u https://github.com/microsoft_google
c PyFunceble -u https://microsoft_google.com
c PyFunceble -u https://microsoft_google.com --local
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Again, use the example.(com|net|org) #L8-L10

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, this is okay.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this demo specifically, I don't know how to use example.org and achieve the same effect as the existing demo does. I don't know how example.net handles URL paths.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You will get a 404 so my first though is to append the example. to the number of lines.

See also #262 (comment) for answer

c exit
}

# vim: filetype=sh