> On Tue, Jan 11, 2011 at 2:29 PM, Ingo Koch <fos...@ikoch.de> wrote:
>
>> I'm working on a C# wrapper library around fossil
>> and I encountered some commands which require user input.
>>
> Tell me about these commands when you encounter them and I'll add
> command-line options to work around the user input.

I think it would be easier to modify the function

void prompt_user(const char *zPrompt, Blob *pIn){
...
  printf("%s", zPrompt); // change to printf("%s\n", zPrompt);
...
}
You could include a setting like prompt-with-newline defaulting to false to let
the users decide whether to insert a newline after the prompt or not.

Anyhow, here is a list of the prompts from within command execution:

void branch_new(void){
...
    prompt_user("unable to sign manifest.  continue (y/N)? ", &ans);
...
}

void clean_cmd(void){
...
    char *prompt = mprintf("remove unmanaged file \"%s\" (y/N)? ",
                            db_column_text(&q, 0));
    blob_zero(&ans);
    prompt_user(prompt, &ans);
...
}

void commit_cmd(void){
...
    prompt_user("continue in spite of sync failure (y/N)? ", &ans);
...
    prompt_user("continue in spite of time skew (y/N)? ", &ans);
...
    prompt_user("empty check-in comment.  continue (y/N)? ", &ans);
...
    prompt_user("unable to sign manifest.  continue (y/N)? ", &ans);
...
}   

int ssl_open(void){
...
    prompt = mprintf("\nUnknown SSL certificate:\n\n%s\n\n%s\n"
                     "Accept certificate [a=always/y/N]? ", desc, warning);
    BIO_free(mem);

    prompt_user(prompt, &ans);
...
}

void scrub_cmd(void){
...
    prompt_user("Scrubbing the repository will permanently remove user\n"
                "passwords and other information. Changes cannot be undone.\n"
                "Continue (y/N)? ", &ans);
...
}

void user_cmd(void){
...
    prompt_user("login: ", &login);
...
    prompt_user("contact-info: ", &contact);
...
}

called by checkout (and open which calls checkout), merge and update:
void vfile_to_disk(
...
    zMsg = mprintf("overwrite %s (a=always/y/N)? ", zName);
    prompt_user(zMsg, &ans);
...
}


_______________________________________________
fossil-users mailing list
fossil-users@lists.fossil-scm.org
http://lists.fossil-scm.org:8080/cgi-bin/mailman/listinfo/fossil-users

Reply via email to