Simple code movement for clarity.

Signed-off-by: Jani Nikula <jani.nik...@intel.com>
---
 dim | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/dim b/dim
index b41beca7301b..60d4d36ef25f 100755
--- a/dim
+++ b/dim
@@ -2290,6 +2290,14 @@ if ! declare -n subcmd=dim_alias_${subcommand//-/_} &> 
/dev/null || \
        subcmd="$subcommand"
 fi
 
+# look up the function by the subcommand name
+subcmd_func=dim_${subcmd//-/_}
+if ! declare -f $subcmd_func >/dev/null; then
+       echoerr "'$subcommand' is not a dim command."
+       dim_usage
+       exit 1
+fi
+
 #
 # Sanity checks.
 #
@@ -2301,14 +2309,6 @@ if [[ -n "${__dim_running:-}" ]]; then
 fi
 export __dim_running=1
 
-# look up the function by the subcommand name
-subcmd_func=dim_${subcmd//-/_}
-if ! declare -f $subcmd_func >/dev/null; then
-       echoerr "'$subcommand' is not a dim command."
-       dim_usage
-       exit 1
-fi
-
 # Commands useful for developers don't need a full dim setup
 if list_developer_commands | grep -qx $subcmd; then
        if [ -r $DIM_PREFIX/drm-rerere/$integration_config ]; then
-- 
2.11.0

_______________________________________________
dim-tools mailing list
dim-tools@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dim-tools

Reply via email to