Skip to content

Conversation

@Parth
Copy link
Contributor

@Parth Parth commented Jan 2, 2016

Added the following error if no args are passed in:

➜  src git:(master) ./tldr 
usage: tldr <command>
Which page do you want to see?
try: tldr tldr
➜  src git:(master)

And the following message if the wrong args are passed in:

➜  src git:(master) ./tldr thisdoesntexist 
This page doesn't exist yet!
Submit new pages here: https://github.com/tldr-pages/tldr
➜  src git:(master) 

fixes #7 #8

Let me know what you guys think 😄

@Leandros
Copy link
Collaborator

Leandros commented Jan 3, 2016

Please adjust your editor settings to keep the current formatting.

@Parth
Copy link
Contributor Author

Parth commented Jan 3, 2016

Oh, sorry about that, will fix

@Parth
Copy link
Contributor Author

Parth commented Jan 3, 2016

@Leandros should be fixed now

@Leandros
Copy link
Collaborator

Leandros commented Jan 3, 2016

Great. Looks good. One tiny improvement and it's ready for the merge. It's better to use argv[0] instead of hardcoding the tldr command, the executable could be named different.

@Parth
Copy link
Contributor Author

Parth commented Jan 3, 2016

Good idea, should be fixed now. @Leandros

@Leandros
Copy link
Collaborator

Leandros commented Jan 3, 2016

You missed the tldr two lines below. ;)
I would also rather return EXIT_SUCCESS, since it's not exactly a failure.

@Parth
Copy link
Contributor Author

Parth commented Jan 4, 2016

Got it! And I checked a few commands and it seems that this type of situation is indeed considered "failure"

➜  src git:(master) git status 
On branch master
Your branch is up-to-date with 'origin/master'.
nothing to commit, working directory clean
➜  src git:(master) echo $?
0
➜  src git:(master) git
usage: git [--version] [--help] [-C <path>] [-c name=value]
           [--exec-path[=<path>]] [--html-path] [--man-path] [--info-path]
           [-p | --paginate | --no-pager] [--no-replace-objects] [--bare]
           [--git-dir=<path>] [--work-tree=<path>] [--namespace=<name>]
           <command> [<args>]

The most commonly used git commands are:
   add        Add file contents to the index
   bisect     Find by binary search the change that introduced a bug
   branch     List, create, or delete branches
   checkout   Switch branches or restore working tree files
   clone      Clone a repository into a new directory
   commit     Record changes to the repository
   diff       Show changes between commits, commit and working tree, etc
   fetch      Download objects and refs from another repository
   grep       Print lines matching a pattern
   init       Create an empty Git repository or reinitialize an existing one
   log        Show commit logs
   merge      Join two or more development histories together
   mv         Move or rename a file, a directory, or a symlink
   pull       Fetch from and integrate with another repository or a local branch
   push       Update remote refs along with associated objects
   rebase     Forward-port local commits to the updated upstream head
   reset      Reset current HEAD to the specified state
   rm         Remove files from the working tree and from the index
   show       Show various types of objects
   status     Show the working tree status
   tag        Create, list, delete or verify a tag object signed with GPG

'git help -a' and 'git help -g' list available subcommands and some
concept guides. See 'git help <command>' or 'git help <concept>'
to read about a specific subcommand or concept.
➜  src git:(master) echo $?
1
➜  src git:(master) 

@Parth
Copy link
Contributor Author

Parth commented Jan 4, 2016

I can cite other examples if you'd like

@Parth
Copy link
Contributor Author

Parth commented Jan 4, 2016

@Leandros

@Leandros
Copy link
Collaborator

Leandros commented Jan 4, 2016

Please merge the current master thread into your branch, it'll run the travis build. And you should notice the bug in your code, since it won't compile.

@Parth
Copy link
Contributor Author

Parth commented Jan 4, 2016

Is it all good now?

@Leandros
Copy link
Collaborator

Leandros commented Jan 4, 2016

Yes. Build passed. Looks good! Merged!

Leandros added a commit that referenced this pull request Jan 4, 2016
@Leandros Leandros merged commit fb7be27 into tldr-pages:master Jan 4, 2016
@Parth
Copy link
Contributor Author

Parth commented Jan 4, 2016

Thanks! 👍

@SethFalco SethFalco mentioned this pull request Apr 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should the client output failure if the page requested isn't found?

2 participants