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

Clone someone's AC codes #19

Closed
xalanq opened this issue Jul 19, 2019 · 5 comments
Closed

Clone someone's AC codes #19

xalanq opened this issue Jul 19, 2019 · 5 comments
Labels
enhancement New feature or request

Comments

@xalanq
Copy link
Owner

xalanq commented Jul 19, 2019

There is a easy way to clone ourselves codes by this bash script

for((i=1;i<=2000;i++)); do cf pull ac $i; done

But it cannot clone other's codes and seems like not good.
So, I decide to add a new command clone for cloning someone's codes.

@xalanq xalanq added the enhancement New feature or request label Jul 19, 2019
@GaurangTandon
Copy link
Contributor

Why not just add a new argument to cf pull, like cf pull user=xalanq ...? By default, let user be the currently logged in user. Thoughts?

@xalanq
Copy link
Owner Author

xalanq commented Jul 19, 2019

By default, if you just use cf pull, it will not pull all your codes (It will detect the parameters from the path). So if the tool use cf pull to clone all codes, it has to add a new parameter or something else. So I decide to add new command clone just like git clone :). What do you think?

@infalmo
Copy link

infalmo commented Jul 19, 2019

You could make cf pull in such a way that if no parameter is provided, pull all submissions of a user. Also, @GaurangTandon s idea could be implemented.

@GaurangTandon
Copy link
Contributor

GaurangTandon commented Jul 19, 2019

I am seeing two things here:

  1. cloning another user's codes (you said "But it cannot clone other's codes")
  2. cloning all codes written by a user (you said "By default, if you just use cf pull, it will not pull all your codes")

For each of these we could add two new parameters to cf pull:

  1. user=<username> - user whose codes you want to pull
  2. since=<date> - specify date starting from which you want to pull all the codes

Specifying since=01/01/1970 would let user, for example, pull all their codes.

I am a bit hesitant about cf clone because it will complicate things for the end user (another command to remember). Whereas in most cases user can ignore the user and since parameters and cf pull will do what they want to (pull codes related to a particular problem).

But these are just suggestions, I am happy to discuss further :)

@xalanq
Copy link
Owner Author

xalanq commented Jul 20, 2019

I partially agree with you. But we should remember not only commands but also the parameters of commands. Both of them should be simpler.

cf pull --user=xalanq --since=01/01/1970

cf clone xalanq

I think the latter is simpler.

On the other hand, I think pulling all codes from Codeforces is not a high frequency requirement. If someone want to do that, just see the usage.

@xalanq xalanq closed this as completed in 589e4cf Jul 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants