You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While working on the psh flags I think that it makes sense to combine
expanded_ps1 = ps_expander(state, psh_vf_getstr(state, "PS1"));
stat = read_cmdline(state, expanded_ps1, &buffer);
xfree(expanded_ps1);
if (stat == 1)
{
puts("");
exit_psh(state, psh_vf_getint(state, "?"));
}
if (stat < 0)
continue;
cmd = new_command();
stat = filpinfo(state, expand_alias(state, buffer), cmd);
xfree(buffer);
if (stat < 0)
{
free_command(cmd);
continue;
}
psh_backend_do_run(state, cmd);
free_command(cmd);
to a function. This would remove the douplicate code between main.c and args.c-c flag and therefore be easier to maintain and make implementing new features faster.
I thought of a function like print_exec_command(psh_state *state, char *buffer) that prints the output to stdout
and / or a function like get_exec_command(psh_state *state, char *buffer) that returns the output.
Before making any greater changes I wanted to hear your opinion on this.
The text was updated successfully, but these errors were encountered:
While working on the psh flags I think that it makes sense to combine
to a function. This would remove the douplicate code between
main.c
andargs.c
-c
flag and therefore be easier to maintain and make implementing new features faster.I thought of a function like
print_exec_command(psh_state *state, char *buffer)
that prints the output tostdout
and / or a function like
get_exec_command(psh_state *state, char *buffer)
that returns the output.Before making any greater changes I wanted to hear your opinion on this.
The text was updated successfully, but these errors were encountered: