Skip to content

Conversation

@xmichaelx
Copy link
Contributor

@xmichaelx xmichaelx commented Aug 31, 2025

Currently default name for file to be created is suggested but in order to accept it user has to copypaste it. This PR allows for just hitting enter and accepting the default filename. Proposed file name is presented in square brackets - pattern that is commonly used when default value can be provided by just hitting enter.

Allows for following:

rffit -d out.dat -c tle/bulk.tle 
Loaded 10556 orbits

1Save highlighted points, provide filename [type 'default' for 2014-01-01T00:00:00_2202.404_9990_-0001.dat]: default
247 points saved in 2014-01-01T00:00:00_2202.162_9990_-0001.dat

================================================================================

@xmichaelx xmichaelx changed the title Support for default filename for rffit output .dat file Support for default filename in rffit output .dat file Aug 31, 2025
@xmichaelx xmichaelx marked this pull request as draft August 31, 2025 13:05
@xmichaelx xmichaelx marked this pull request as ready for review August 31, 2025 15:36
printf("Save highlighted points, provide filename [type 'default' for %s]: ",default_filename);
status = scanf("%s",filename);

if (strcmp(filename, "default") == 0 ) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

From the PR description, you can just type enter. From the code you have to explicitly type 'default'.
I would prefer the behavior of the description. So if the string is empty, use the proposed default, otherwise the provided filename.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

scanf does not allow for just entering empty string (simply hitting enter) or to be more precise - i did not found a way to just accept empty string - if you have an idea on how to handle both hitting enter to get default value and be able to provide filename then it would be most welcome.

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.

2 participants