Exit Application
Description
The exit command terminates the AccordionShell application. This cleanly closes any active connections and exits the program.
Syntax
exit
Options
This command has no options.
Examples
Exit the Application
exit
Output:
See ya later!
The application then terminates.
In Script Context
# Connect and perform operations
init --host 192.168.1.100
get --channel "SENSOR_1"
set --channel "OUTPUT" --value "1"
# Clean exit
exit
Output Format
See ya later!
Output Colors
-
Dark Yellow: Exit message
Behavior
-
Displays farewell message
-
Calls
Environment.Exit(0) -
Immediately terminates application
-
Exit code: 0 (success)
Use Cases
Interactive Mode Exit
AccordionShell.exe
> init --host accordion-dev
> list
> get --channel "STATUS"
> exit
Application closes and returns to shell prompt.
Script Completion
# script.bat
AccordionShell.exe init --host 192.168.1.100
AccordionShell.exe set --channel "POWER" --value "ON"
AccordionShell.exe wait --channel "READY" --value "1"
AccordionShell.exe exit
Ensures clean termination after scripted operations.
Error Recovery Exit
# If errors occur, exit cleanly
init --host 192.168.1.100
# ... error occurs ...
exit # Clean shutdown
Connection Handling
Active Connections
exit terminates immediately:
-
Does NOT send disconnect to hardware
-
Does NOT wait for pending operations
-
Connection is abruptly closed
Best Practice: For clean disconnection, use specific disconnect options first:
# Clean disconnect for firmware operations
firmware --disconnect
exit
# For standard operations, exit is sufficient
exit
Alternatives to Exit
|
Alternative |
Use Case |
|---|---|
|
|
Interrupt running operation, then exit |
|
|
Disconnect SSH session before exit |
|
Close window |
Force termination (not recommended) |
Exit Codes
|
Code |
Meaning |
|---|---|
|
0 |
Normal exit via |
|
Other |
Abnormal termination or error |
Notes
-
Immediate: Exit is immediate, no confirmation prompt
-
No Cleanup: Does not perform hardware cleanup operations
-
State Lost: Any unsaved state is lost
-
Connection: Hardware connection is dropped (hardware continues running)
Best Practices
-
Save Work First: Ensure critical operations are complete
-
Document State: Note hardware state before exiting
-
Clean Disconnect: Use firmware disconnect for SSH sessions
-
Script Usage: Always include
exitat end of scripts
Interactive Mode
In interactive mode, you can also exit by:
-
Typing
exit -
Pressing
Ctrl+C(keyboard interrupt) -
Closing the terminal window
The exit command is the cleanest method.
Script Mode
In script mode, exit is typically not needed as AccordionShell exits after executing the command:
# This exits automatically after execution
AccordionShell.exe get --channel "SENSOR"
# Exit is redundant but harmless
AccordionShell.exe get --channel "SENSOR"
AccordionShell.exe exit
Comparison with Other Commands
|
Command |
Purpose |
Connection |
|---|---|---|
|
|
Terminate application |
Dropped |
|
|
Close SSH session |
SSH closed, app continues |
|
|
Reset hardware |
Maintained |
Error Scenarios
Cannot Exit (Theoretical)
The exit command calls Environment.Exit(0) which forcefully terminates the process. It cannot fail under normal circumstances.
If the application appears frozen:
-
Press
Ctrl+C -
Close terminal window
-
Use Task Manager (Windows) or
killcommand (Linux)
Example Sessions
Quick Check Session
$ AccordionShell.exe
> init --host 192.168.1.50
Connected to 192.168.1.50
> get --channel "TEMPERATURE"
23.5 °C
> exit
See ya later!
$
Configuration Session
$ AccordionShell.exe
> init --host accordion-lab-01
> alias --activate "lab_config.xml"
> list --filter "POWER.*"
POWER_MAIN: ON
POWER_AUX: OFF
> set --channel "POWER_AUX" --value "ON"
> exit
See ya later!
$