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

gmt.c: add classic option to --new-script #5403

Closed
wants to merge 1 commit into from
Closed

gmt.c: add classic option to --new-script #5403

wants to merge 1 commit into from

Conversation

anbj
Copy link
Contributor

@anbj anbj commented Jun 28, 2021

I've added the option --new-script-classic to gmt to make a script template without the modern mode related output.
You know, for the old-timers.

This was just an experiment to play with C. Consider to merge. I wont be sad if you choose not to.

fprintf (stderr, " --show-plugindir Show directory for plug-ins.\n");
fprintf (stderr, " --show-sharedir Show directory for shared GMT resources.\n");
fprintf (stderr, " --show-userdir Show full path of user's ~/.gmt dir\n");
fprintf (stderr, " --version Print GMT version number.\n\n");
fprintf (stderr, "if <module-options> is \'=\' we call exit (0) if module exist and non-zero otherwise.\n\n");
status = GMT_NOERROR;
}
Copy link
Member

Choose a reason for hiding this comment

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

Please, do not change the formatting. Those tabs above should not be there. Only spaces guarantee a good alignment in all editor settings (and possible terminals)

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'm very certain I used spaces when I made the changes, and double checked now. Do they appear as tabs to you?

Copy link
Member

Choose a reason for hiding this comment

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

Hi @anbj, while it may not be used a lot I am OK with accepting your contribution. However, I'd like to see a few changes:

  1. Split the new-script usage message into two separate lines, one for classic and the original one, as is done for other classic versions of options.
  2. Use less spaces: Only 1 after the longest of all entries, which after splitting into two lines will remain the show-modules-core I think. As per Improve usage documentation and break synopsis lines for all GMT modules #5341, we want to keep things tighter.
  3. You need to add an entry in the gmt.rst file as well for documentation.

@joa-quim
Copy link
Member

I don't know how to load your branch without doing a fork of your fork but when I see this displayed by github it normally means tabs
image

@anbj
Copy link
Contributor Author

anbj commented Jun 28, 2021

You can check out a PR branch with:

git fetch origin pull/<ID>/head:<BRANCHNAME>
git checkout BRANCHNAME

So in this case it would be:

git fetch origin pull/5403/head:add-classic-script-template
git checkout add-classic-script-template

But again, I typed space when I did this, so it should be good.

@joa-quim
Copy link
Member

OK, thanks. No big deal either (and easy to fix in case they were there). But can't look more at this now. Need to go out.

@joa-quim
Copy link
Member

Regarding the PR, I have no particular opinion. Asking classic prints this

gmt --new-script-classic
@echo off
REM Date:    2021-06-28T20:48:53
REM User:    j
REM Purpose: Purpose of this script

which does not seem a particular useful bit of info.

@anbj
Copy link
Contributor Author

anbj commented Jul 1, 2021

I'm closing this. It was fun to do, but with 1-2 people using it, it's not worth the code change.

@anbj anbj closed this Jul 1, 2021
@PaulWessel
Copy link
Member

Sorry we could not be more welcoming on this one... But see #5341 if you want to practice more C!

@anbj
Copy link
Contributor Author

anbj commented Jul 1, 2021

No worries! I'll check out #5341!

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.

3 participants