Previously, agent was registered only for the interactive mode. This patch enables agent registration in non-interactive mode taking into consideration the existence of the command-line options.