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

feat: history command #97

Merged
merged 7 commits into from
Mar 27, 2024
Merged

feat: history command #97

merged 7 commits into from
Mar 27, 2024

Conversation

radulucut
Copy link
Collaborator

@radulucut radulucut commented Mar 22, 2024

globalping history
1 | 2024-03-27 11:56:46 | ping google.com
> https://www.jsdelivr.com/globalping?measurement=itcR65tYCqbouXib
- | 2024-03-27 11:57:01 | dns google.com from last
> https://www.jsdelivr.com/globalping?measurement=kWc5UBK9A6G4RUYM
2 | 2024-03-27 11:57:20 | traceroute google.com from New York --limit 2
> https://www.jsdelivr.com/globalping?measurement=Yz7A1UifUonZsC3C
3 | 2024-03-27 11:57:37 | mtr google.com from New York --limit 2
> https://www.jsdelivr.com/globalping?measurement=SX1NBgfDKiabM1vZ
4 | 2024-03-27 11:57:52 | http google.com from London,Belgium --limit 2 --method get --ci
> https://www.jsdelivr.com/globalping?measurement=eclwFSYX0zgU10Cs

globalping history --head 2
1 | 2024-03-27 11:56:46 | ping google.com
> https://www.jsdelivr.com/globalping?measurement=itcR65tYCqbouXib
- | 2024-03-27 11:57:01 | dns google.com from last
> https://www.jsdelivr.com/globalping?measurement=kWc5UBK9A6G4RUYM

globalping history --tail 2
4 | 2024-03-27 11:57:52 | http google.com from London,Belgium --limit 2 --method get --ci
> https://www.jsdelivr.com/globalping?measurement=eclwFSYX0zgU10Cs
3 | 2024-03-27 11:57:37 | mtr google.com from New York --limit 2
> https://www.jsdelivr.com/globalping?measurement=SX1NBgfDKiabM1vZ

@jimaek
Copy link
Member

jimaek commented Mar 22, 2024

Those flags are probably the most useful options we have, by moving them deeper and effectively removing from the main readme and CLI docs we will make it much harder for people to understand the functionality and to find them.

@radulucut radulucut marked this pull request as ready for review March 25, 2024 10:40
Copy link
Member

@MartinKolarik MartinKolarik left a comment

Choose a reason for hiding this comment

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

  • if there's no history, the output should be empty, no errors
  • the order appears to be reversed; it needs to be old -> new, and the number must match exactly what I'd get when using ping from @x
  • ^ also means commands that use previous etc don't get their own number in history, see the example in my original issue (between 2 and 3 there's one without number)

README.md Outdated Show resolved Hide resolved
@MartinKolarik
Copy link
Member

Let's also remove the default limit and show all items by default.

@MartinKolarik
Copy link
Member

Also I think all unix tools use --head/--tail instead of --first/--last so let's rename that as well.

@MartinKolarik MartinKolarik linked an issue Mar 27, 2024 that may be closed by this pull request
@MartinKolarik MartinKolarik merged commit c522c89 into jsdelivr:master Mar 27, 2024
3 checks passed
@radulucut radulucut deleted the history branch March 28, 2024 06:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

History command
3 participants